MediaWiki:Common.js: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 36: Line 36:
     // Using delegated event handling for both #list and #list-list
     // Using delegated event handling for both #list and #list-list
     $('#list, #list-list').on('mousedown', '.filtered-value-option', function(event) {
     $('#list, #list-list').on('mousedown', '.filtered-value-option', function(event) {
        console.log("Filter clicked");
    console.log("Filter clicked within context:", this);
 
        // Check if the event occurred within #list or #list-list
    if ($(this).closest('#list').length) {
        if ($(this).closest('#list').length) {
        console.log("Context: #list");
            // If inside #list
        communityFeatured.hide();
            communityFeatured.hide();
        console.log("Community Featured should now be hidden. Current display:", communityFeatured.css('display'));
            console.log("Community Featured should now be hidden");
    } else if ($(this).closest('#list-list').length) {
        } else if ($(this).closest('#list-list').length) {
        console.log("Context: #list-list");
            // If inside #list-list
        communityListFeatured.hide();
            communityListFeatured.hide();
        console.log("Community List Featured should now be hidden. Current display:", communityListFeatured.css('display'));
            console.log("Community List Featured should now be hidden");
    }
        }
});
    });


     function formatParagraphs(text) {
     function formatParagraphs(text) {

Navigation menu