4,554
edits
No edit summary |
No edit summary Tag: Reverted |
||
Line 38: | Line 38: | ||
}); | }); | ||
function updateFirstItemBorder() { | |||
var visibleItems = $('#list-list .filtered-list-item').filter(function() { | |||
return $(this).css('display') !== 'none'; | |||
}); | |||
// 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'); | |||
} | |||
} | |||
// Event listener for filter changes | |||
$('.filtered-value-option input[type="checkbox"]').on('change', function() { | |||
setTimeout(updateFirstItemBorder, 100); // Delay to allow for filter processing | |||
}); | |||
// 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() !== '' }); |