4,554
edits
No edit summary Tags: Manual revert Reverted |
No edit summary Tag: Manual revert |
||
Line 37: | Line 37: | ||
communityListFeatured.hide(); | communityListFeatured.hide(); | ||
console.log("Community List Featured should now be hidden"); | console.log("Community List Featured should now be hidden"); | ||
}); | }); | ||
Line 93: | Line 91: | ||
function updateBorder() { | function updateBorder() { | ||
var visibleItems = $('#list-list div.filtered-list-item').filter(function() { | var visibleItems = $('#list-list div.filtered-list-item').filter(function() { | ||
return $(this).css('display') !== 'none'; | return $(this).css('display') !== 'none'; | ||
}); | }); | ||
$('#list-list div.filtered-list-item').css('border-bottom', 'none'); | |||
if (visibleItems.length === 1) { | if (visibleItems.length === 1) { | ||
visibleItems.css('border-bottom', '1px solid black'); | visibleItems.css('border-bottom', '1px solid black'); | ||
} | } | ||
} | } | ||
// Create a MutationObserver to monitor changes in the list | |||
var observer = new MutationObserver(function(mutations) { | |||
mutations.forEach(function(mutation) { | |||
if (mutation.type === 'attributes' && mutation.attributeName === 'style') { | |||
updateBorder(); | |||
} | |||
}); | |||
}); | |||
// Start observing the list for attribute changes | |||
$('#list-list div.filtered-list-item').each(function() { | |||
observer.observe(this, { attributes: true }); | |||
}); | |||
// Initial call to set the border correctly on page load | |||
updateBorder(); | |||
// Delegate the mousedown event to the '.card' elements inside the '#list' container | // Delegate the mousedown event to the '.card' elements inside the '#list' container |