4,114
edits
No edit summary Tag: Manual revert |
No edit summary |
||
Line 82: | Line 82: | ||
// Using delegated event handling for both #list, #list-list and their variations | // 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 and hide the corresponding communityFeatured element | |||
var context = $(this).closest('[id]').attr('id'); // Get the closest parent with an ID | |||
switch (context) { | |||
case 'list': | |||
communityFeatured.hide(); | |||
break; | |||
case 'list-block-1': | |||
communityFeaturedBlock1.hide(); | |||
break; | |||
case 'list-block-2': | |||
communityFeaturedBlock2.hide(); | |||
break; | |||
case 'list-block-3': | |||
communityFeaturedBlock3.hide(); | |||
break; | |||
case 'list-list-1': | |||
communityFeaturedList1.hide(); | |||
break; | |||
case 'list-list-2': | |||
communityFeaturedList2.hide(); | |||
break; | |||
case 'list-list-3': | |||
communityFeaturedList3.hide(); | |||
break; | |||
default: | |||
// If the context does not match any case, you can log it or handle it as needed | |||
console.log("Unknown context:", context); | |||
} | |||
// 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 |