4,554
edits
No edit summary |
No edit summary |
||
Line 129: | Line 129: | ||
checkFiltersCleared('#list-list', communityListFeatured); | checkFiltersCleared('#list-list', communityListFeatured); | ||
// Function to check if all filters are cleared and return boolean | |||
function areFiltersCleared(selector) { | |||
var checkedFilters = $(selector + ' .filtered-value-option input[type="checkbox"]:checked'); | |||
return checkedFilters.length === 0; | |||
} | |||
// Function to open the modal and adjust the list | // Function to open the modal and adjust the list | ||
Line 252: | Line 257: | ||
} | } | ||
// | // Modified closeModal function | ||
function closeModal() { | |||
showArticleWrapper.hide(); | showArticleWrapper.hide(); | ||
list.width(originalListWidth).css('margin-right', '0'); | list.width(originalListWidth).css('margin-right', '0'); | ||
Line 260: | Line 265: | ||
// Revert width of filtered-list-items in #list | // Revert width of filtered-list-items in #list | ||
filteredListItems.css('width', 'calc(20% - 2px)'); | filteredListItems.css('width', 'calc(20% - 2px)'); | ||
// | // Check if filters are cleared before showing community elements | ||
if (areFiltersCleared('#list')) { | |||
communityFeatured.show(); | |||
} | |||
if (areFiltersCleared('#list-list')) { | |||
communityListFeatured.show(); | |||
} | |||
} | } | ||