MediaWiki:Common.js: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 296: Line 296:
     }
     }
      
      
    // Attach a mousedown event listener to close the fixed column
     $(document).on('mousedown', function (event) {
     $(document).on('mousedown', function (event) {
        // 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
        if (!showArticleWrapper.is(event.target) && showArticleWrapper.has(event.target).length === 0 && !$(event.target).hasClass('card')) {
    // Now also checking if it's not on a card within #list-list
            // Remove the fade-out class when hiding the fixed column
    if (!showArticleWrapper.is(event.target) &&  
            $('#list').removeClass('fade-out');
        showArticleWrapper.has(event.target).length === 0 &&  
            showArticleWrapper.css('display', 'none');
        !$(event.target).closest('#list, #list-list').find('.card').length) {
        }
       
    });
        // Remove the fade-out class when hiding the fixed column
        $('#list, #list-list').removeClass('fade-out');
        showArticleWrapper.css('display', 'none');
    }
});
 


     // Attach a click event listener to close the fixed column when clicking the close button
     // Attach a click event listener to close the fixed column when clicking the close button

Navigation menu