4,554
edits
No edit summary Tag: Manual revert |
No edit summary |
||
Line 287: | Line 287: | ||
$(document).on('mousedown', function (event) { | $(document).on('mousedown', function (event) { | ||
console.log('Document mousedown event triggered'); | |||
console.log('Event target:', event.target); | |||
// Check if the click is outside of the #show-article-wrapper and not on a card | // Check if the click is outside of the #show-article-wrapper and not on a card | ||
// Now also checking if it's not on a card within #list-list | // Now also checking if it's not on a card within #list-list | ||
var isOutsideWrapper = !showArticleWrapper.is(event.target) && showArticleWrapper.has(event.target).length === 0; | |||
var isNotOnCard = !$(event.target).closest('#list, #list-list').find('.card, .list-card').length; | |||
console.log('Is outside wrapper:', isOutsideWrapper); | |||
console.log('Is not on card:', isNotOnCard); | |||
if (isOutsideWrapper && isNotOnCard) { | |||
console.log('Hiding fixed column'); | |||
// Remove the fade-out class when hiding the fixed column | // Remove the fade-out class when hiding the fixed column | ||
$('#list, #list-list').removeClass('fade-out'); | $('#list, #list-list').removeClass('fade-out'); | ||
showArticleWrapper.css('display', 'none'); | showArticleWrapper.css('display', 'none'); | ||
} else { | |||
console.log('Click inside wrapper or on card'); | |||
} | } | ||
}); | }); | ||
$('#close-button').on('click', function () { | $('#close-button').on('click', function () { |