4,554
edits
No edit summary Tag: Reverted |
No edit summary Tag: Reverted |
||
Line 38: | Line 38: | ||
}); | }); | ||
function updateFirstItemBorder() { | // Function to update border-top for the first visible item | ||
function updateFirstItemBorder() { | |||
var visibleItems = $('#list-list .filtered-list-item').filter(function() { | var visibleItems = $('#list-list .filtered-list-item').filter(function() { | ||
return $(this).css('display') !== 'none'; | 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 | // Remove border-top from all items first | ||
Line 49: | Line 52: | ||
if (visibleItems.length > 0) { | if (visibleItems.length > 0) { | ||
visibleItems.first().css('border-top', '1px solid black'); | 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"); | |||
} | } | ||
} | } | ||
Line 55: | Line 61: | ||
$('.filtered-value-option input[type="checkbox"]').on('change', function() { | $('.filtered-value-option input[type="checkbox"]').on('change', function() { | ||
setTimeout(updateFirstItemBorder, 100); // Delay to allow for filter processing | setTimeout(updateFirstItemBorder, 100); // Delay to allow for filter processing | ||
console.log("Filter change detected"); | |||
}); | }); | ||
// Initial call | // Initial call | ||
updateFirstItemBorder(); | 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() !== '' }); |