MediaWiki:Common.js: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
Tag: Manual revert
No edit summary
Tag: Reverted
Line 554: Line 554:


     // Close modal and remove fade out also when clicking outside of card
     // Close modal and remove fade out also when clicking outside of card
    $(document).on('mousedown', function (event) {
$(document).on('mousedown', function (event) {
        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 isOnCard = $(event.target).closest('.card, .list-card').length > 0;
    var isOnCard = $(event.target).closest('.card, .list-card').length > 0;
       
   
        if (isOutsideWrapper && !isOnCard) {
    if (isOutsideWrapper && !isOnCard) {
            console.log('Closing modal from outside wrapper and not on card');
        console.log('Closing modal from outside wrapper and not on card');
            $('#list, #list-list, #list-list-1, #list-list-2, #list-list-3, #list-block-1, #list-block-2, #list-block-3').removeClass('fade-out');
        $('#list, #list-list, #list-list-1, #list-list-2, #list-list-3, #list-block-1, #list-block-2, #list-block-3').removeClass('fade-out');
        showArticleWrapper.css('display', 'none');
        showArticleWrapper.css('display', 'none');
            closeModal(); // Use closeModal() for cleanup
       
        }
        // Call both filter-checking functions to handle visibility of communityFeatured elements
    });
        checkBlockFiltersCleared();
        checkListFiltersCleared();
    }
});


     // Hover effect for scrolling
     // Hover effect for scrolling

Navigation menu