4,114
edits
No edit summary |
No edit summary |
||
Line 26: | Line 26: | ||
} | } | ||
} | } | ||
// Check if the specific element exists on the page | // Check if the specific element exists on the page | ||
Line 51: | Line 50: | ||
} | } | ||
// Using delegated event handling for both #list | // Using delegated event handling for both #list, #list-list and their variations | ||
$('#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); | |||
// Check context for #list and its block variations | |||
if ($(this).closest('#list, #list-block-1, #list-block-2, #list-block-3').length) { | |||
console.log("Context: #list or one of its block variations"); | |||
console.log("Before hiding, Community Featured display:", communityFeatured.css('display')); | |||
communityFeatured.hide(); // Assuming you want to hide communityFeatured in this context | |||
console.log("After hiding, Community Featured display:", communityFeatured.css('display')); | |||
} | |||
// Check context for #list-list and its list variations | |||
else if ($(this).closest('#list-list, #list-list-1, #list-list-2, #list-list-3').length) { | |||
console.log("Context: #list-list or one of its list variations"); | |||
console.log("Before hiding, Community List Featured display:", communityFeatured.css('display')); | |||
communityFeatured.hide(); // Assuming you want to hide communityFeatured in this context | |||
console.log("After hiding, Community List Featured display:", communityFeatured.css('display')); | |||
} | |||
// Additional debugging: Check the event target and its parents | |||
console.log("Event target:", event.target); | |||
console.log("Parents of event target:", $(event.target).parents()); | |||
}); | |||
// Format paragraphs | // Format paragraphs |