MediaWiki:Common.js: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
Tag: Manual revert
No edit summary
Line 88: Line 88:
         console.log("Button or Filters div not found with jQuery.");
         console.log("Button or Filters div not found with jQuery.");
     }
     }
   
    // Function to check if all filters are cleared
    function checkFiltersCleared() {
        var checkedFilters = $('#list-list .filtered-value-option input[type="checkbox"]:checked');
        console.log("Checked filters count:", checkedFilters.length);
        if (checkedFilters.length === 0) {
            console.log("All filters are cleared");
            communityListFeatured.show();
        } else {
            console.log("Some filters are still active");
        }
    }
    // Event delegation for filter changes
    $('#list-list').on('change', '.filtered-value-option input[type="checkbox"]', function() {
        setTimeout(checkFiltersCleared, 100); // Delay to allow for filter processing
        console.log("Filter change detected");
    });
    // Initial check
    checkFiltersCleared();
     // Delegate the mousedown event to the '.card' elements inside the '#list' container
     // Delegate the mousedown event to the '.card' elements inside the '#list' container

Navigation menu