4,114
edits
No edit summary |
No edit summary |
||
Line 145: | Line 145: | ||
} | } | ||
// Event delegation for filter changes in | // Event delegation for filter changes in block, list views, and their variations | ||
$('#list, #list-list').on('change', '.filtered-value-option input[type="checkbox"]', function() { | $('#list, #list-list, #list-block-1, #list-block-2, #list-block-3, #list-list-1, #list-list-2, #list-list-3').on('change', '.filtered-value-option input[type="checkbox"]', function() { | ||
// Determine the closest list | // Determine the closest list, list-list, or their variations to identify the context | ||
var closestContext = $(this).closest('#list, #list-list'); | var closestContext = $(this).closest('#list, #list-list, #list-block-1, #list-block-2, #list-block-3, #list-list-1, #list-list-2, #list-list-3'); | ||
var contextId = closestContext.attr('id'); // Get the id | var contextId = closestContext.attr('id'); // Get the id of the closest context | ||
// Call the checkFiltersCleared function with the appropriate context and communityFeatured element | // Call the checkFiltersCleared function with the appropriate context and communityFeatured element | ||
checkFiltersCleared('#' + contextId, communityFeatured); | checkFiltersCleared('#' + contextId, communityFeatured); | ||
}); | }); | ||
// Initial checks | // Initial checks |