4,554
edits
No edit summary |
No edit summary |
||
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"); | ||
updateBorder(); | |||
console.log("Border updated"); | |||
}); | }); | ||
Line 89: | Line 91: | ||
console.log("Button or Filters div not found with jQuery."); | console.log("Button or Filters div not found with jQuery."); | ||
} | } | ||
function updateBorder() { | |||
// Remove the border from all items first | |||
$('#list-list div.filtered-list-item').css('border-bottom', 'none'); | |||
// Count the number of visible items | |||
var visibleItems = $('#list-list div.filtered-list-item').filter(function() { | |||
return $(this).css('display') !== 'none'; | |||
}); | |||
// If there's only one visible item, add the border | |||
if (visibleItems.length === 1) { | |||
visibleItems.css('border-bottom', '1px solid black'); | |||
} | |||
} | |||
// Run the function 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 |