MediaWiki:Common.js: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 145: Line 145:
}
}


     // Event delegation for filter changes in both block and list views
     // 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 or list-list element to identify the context
         // 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 ('list' or 'list-list')
         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

Navigation menu