4,385
edits
No edit summary |
No edit summary |
||
Line 144: | Line 144: | ||
// Event delegation for filter changes in block view | /* // Event delegation for filter changes in block view | ||
$('#list').on('change', '.filtered-value-option input[type="checkbox"]', function() { | $('#list').on('change', '.filtered-value-option input[type="checkbox"]', function() { | ||
checkFiltersCleared('#list', communityFeatured); // Call the function directly without delay | checkFiltersCleared('#list', communityFeatured); // Call the function directly without delay | ||
Line 152: | Line 152: | ||
$('#list-list').on('change', '.filtered-value-option input[type="checkbox"]', function() { | $('#list-list').on('change', '.filtered-value-option input[type="checkbox"]', function() { | ||
checkFiltersCleared('#list-list', communityFeatured); // Call the function directly without delay | checkFiltersCleared('#list-list', communityFeatured); // Call the function directly without delay | ||
}); | }); */ | ||
// TRY | |||
// Event delegation for filter changes in both block and list views | |||
$('#list, #list-list').on('change', '.filtered-value-option input[type="checkbox"]', function() { | |||
// Determine the closest list or list-list element to identify the context | |||
var closestContext = $(this).closest('#list, #list-list'); | |||
var contextId = closestContext.attr('id'); // Get the id ('list' or 'list-list') | |||
// Call the checkFiltersCleared function with the appropriate context and communityFeatured element | |||
checkFiltersCleared('#' + contextId, communityFeatured); | |||
}); | |||
// Initial checks | // Initial checks |