MediaWiki:Common.js: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 10: Line 10:
     var originalListWidth = list.width(); // Store the original width for #list
     var originalListWidth = list.width(); // Store the original width for #list
     var originalListListWidth = listList.width(); // Store the original width for #list-list
     var originalListListWidth = listList.width(); // Store the original width for #list-list
   
    // Initial check to set the visibility based on the current state of filters
    updateFeaturedVisibility();
      
      
     if (communityFeatured.length && filteredCards.length >= 2) {
     if (communityFeatured.length && filteredCards.length >= 2) {
Line 289: Line 292:
    }
    }
}
}
// Function to update the visibility of featured elements based on filters
function updateFeaturedVisibility() {
    if ($('#list .filtered-value-option input[type="checkbox"]:checked').length === 0) {
        communityFeatured.show();
    } else {
        communityFeatured.hide();
    }
    if ($('#list-list .filtered-value-option input[type="checkbox"]:checked').length === 0) {
        communityListFeatured.show();
    } else {
        communityListFeatured.hide();
    }
}


// closeModal function
// closeModal function

Navigation menu