4,554
edits
No edit summary Tag: Manual revert |
No edit summary |
||
Line 268: | Line 268: | ||
// Function to close the modal and revert the list changes | // Function to close the modal and revert the list changes | ||
function closeModal() { | function closeModal() { | ||
showArticleWrapper.hide(); | |||
list.width(originalListWidth).css('margin-right', '0'); | |||
listList.width(originalListListWidth).css('margin-right', '0'); | |||
// Revert width of filtered-list-items in #list | |||
filteredListItems.css('width', 'calc(20% - 2px)'); | |||
// Check if any filters are active | |||
var areFiltersActive = $('#list-list .filtered-value-option input[type="checkbox"]:checked').length > 0; | |||
// Show communityFeatured only if no filters are active | |||
if (!areFiltersActive) { | |||
communityFeatured.show(); | |||
communityListFeatured.show(); | |||
} | |||
} | |||
// Delegate the mousedown event for both block view and list view pages | // Delegate the mousedown event for both block view and list view pages | ||
$('#list, #list-list').on('mousedown', '.card, .list-card', function (event) { | $('#list, #list-list').on('mousedown', '.card, .list-card', function (event) { |