MediaWiki:Common.js: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 32: Line 32:
     }
     }
      
      
     // Attach a click event handler to all elements with class 'filtered-value-option-label'
     // Using delegated event handling
     $('.filtered-value-option-label').on('click', function() {
     $(document).on('click', '.filtered-value-option-label', function() {
         console.log("Filter clicked");
         console.log("Filter clicked");
        // Hide the community list featured section when a filter is clicked
         communityListFeatured.hide();
         communityListFeatured.hide();
         console.log("Community List Featured should now be hidden");
         console.log("Community List Featured should now be hidden");
     });
     });


     // Optional: Attach a click event handler to a 'clear filters' button
     // Optional: Clear filters event
    // Replace '.clear-filters' with the selector for your clear filter button
     $(document).on('click', '.clear-filters', function() {
     $('.clear-filters').on('click', function() {
         console.log("Clear filters clicked");
         console.log("Clear filters clicked");
        // Show the community list featured section when filters are cleared
         communityListFeatured.show();
         communityListFeatured.show();
         console.log("Community List Featured should now be visible");
         console.log("Community List Featured should now be visible");

Navigation menu