MediaWiki:Common.js: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Tag: Reverted
Line 64: Line 64:
     }
     }
      
      
     // Using delegated event handling for both #list and #list-list
     // Using delegated event handling for both #list #list-list #list-block-1, #list-block-2, #list-block-3, #list-list-1, #list-list-2, #list-list-3
$('#list, #list-list').on('mousedown', '.filtered-value-option', function(event) {
$('#list, #list-list, #list-block-1, #list-block-2, #list-block-3, #list-list-1, #list-list-2, #list-list-3').on('mousedown', '.filtered-value-option', function(event) {
    console.log("Filter clicked within context:", this);
    console.log("Filter clicked within context:", this);
    if ($(this).closest('#list').length) {
    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');
        console.log("Context: #list");
   
    if (closestContext.is('#list, #list-block-1, #list-block-2, #list-block-3')) {
        console.log("Context: #list or blocks");
        console.log("Before hiding, Community Featured display:", communityFeatured.css('display'));
        console.log("Before hiding, Community Featured display:", communityFeatured.css('display'));
        console.log("After hiding, Community Featured display:", communityFeatured.css('display'));
        console.log("After hiding, Community Featured display:", communityFeatured.css('display'));
    } else if ($(this).closest('#list-list').length) {
    } else if (closestContext.is('#list-list, #list-list-1, #list-list-2, #list-list-3')) {
        console.log("Context: #list-list");
        console.log("Context: #list-list or list lists");
        console.log("Before hiding, Community List Featured display:", communityListFeatured.css('display'));
        console.log("Before hiding, Community List Featured display:", communityListFeatured.css('display'));
        console.log("After hiding, Community List Featured display:", communityListFeatured.css('display'));
        console.log("After hiding, Community List Featured display:", communityListFeatured.css('display'));

Navigation menu