4,554
edits
No edit summary |
No edit summary |
||
Line 286: | Line 286: | ||
} | } | ||
$(document).on('mousedown', function (event) { | |||
console.log('Document mousedown event triggered'); | console.log('Document mousedown event triggered'); | ||
console.log('Event target:', event.target); | console.log('Event target:', event.target); | ||
var isOutsideWrapper = !showArticleWrapper.is(event.target) && showArticleWrapper.has(event.target).length === 0; | var isOutsideWrapper = !showArticleWrapper.is(event.target) && showArticleWrapper.has(event.target).length === 0; | ||
var | // Check if the click is directly on a .card or .list-card, or inside one of them | ||
var isOnCard = $(event.target).closest('.card, .list-card').length > 0; | |||
console.log('Is outside wrapper:', isOutsideWrapper); | console.log('Is outside wrapper:', isOutsideWrapper); | ||
console.log('Is | console.log('Is on card:', isOnCard); | ||
if (isOutsideWrapper && | if (isOutsideWrapper && !isOnCard) { | ||
console.log('Hiding fixed column'); | console.log('Hiding fixed column'); | ||
$('#list, #list-list').removeClass('fade-out'); | $('#list, #list-list').removeClass('fade-out'); | ||
showArticleWrapper.css('display', 'none'); | showArticleWrapper.css('display', 'none'); | ||
Line 307: | Line 305: | ||
} | } | ||
}); | }); | ||
$('#close-button').on('click', function () { | $('#close-button').on('click', function () { |