|
|
Line 38: |
Line 38: |
| }); | | }); |
|
| |
|
| // Function to update border-top for the first visible item
| |
| function updateFirstItemBorder() {
| |
| var visibleItems = $('#list-list .filtered-list-item').filter(function() {
| |
| return $(this).css('display') !== 'none';
| |
| });
| |
|
| |
| console.log("Number of visible items:", visibleItems.length); // Log number of visible items
| |
|
| |
| // Remove border-top from all items first
| |
| $('#list-list .filtered-list-item').css('border-top', 'none');
| |
|
| |
| // Add border-top to the first visible item
| |
| if (visibleItems.length > 0) {
| |
| visibleItems.first().css('border-top', '1px solid black');
| |
| console.log("Border-top added to the first visible item");
| |
| } else {
| |
| console.log("No visible items found");
| |
| }
| |
| }
| |
|
| |
| // Event listener for filter changes
| |
| $('.filtered-value-option input[type="checkbox"]').on('change', function() {
| |
| setTimeout(updateFirstItemBorder, 100); // Delay to allow for filter processing
| |
| console.log("Filter change detected");
| |
| });
| |
|
| |
| // Initial call
| |
| updateFirstItemBorder();
| |
|
| |
| function formatParagraphs(text) { | | function formatParagraphs(text) { |
| var paragraphs = text.split('\n').filter(function (p) { return p.trim() !== '' }); | | var paragraphs = text.split('\n').filter(function (p) { return p.trim() !== '' }); |