4,435
edits
No edit summary |
No edit summary |
||
Line 7: | Line 7: | ||
// Delegate the mousedown event to the '.card' elements inside the '#list' container | // Delegate the mousedown event to the '.card' elements inside the '#list' container | ||
$('#list').on('mousedown', '.card', function (event) { | $('#list').on('mousedown', '.card', function (event) { | ||
if ($(event.target).closest('.people a').length) { | // Check if the clicked element or its parent is a link inside '.people' or '.type' | ||
return; // Clicked on a link inside '.people', do nothing | if ($(event.target).closest('.people a, .type a').length) { | ||
return; // Clicked on a link inside '.people' or '.type', do nothing | |||
} | } | ||