MediaWiki:Common.js: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 264: Line 264:
     }
     }


    // Modified closeModal function
function closeModal() {
function closeModal() {
    showArticleWrapper.hide();
    showArticleWrapper.hide();
Line 272: Line 271:
    // Revert width of filtered-list-items in #list
    // Revert width of filtered-list-items in #list
    filteredListItems.css('width', 'calc(20% - 2px)');
    filteredListItems.css('width', 'calc(20% - 2px)');
   
    checkBlockFiltersCleared();
    checkListFiltersCleared();
}
}


     // Delegate the mousedown event for both block view and list view pages
     // Delegate the mousedown event for both block view and list view pages
Line 330: Line 333:
});
});


    $('#close-button').on('click', function () {
$('#close-button').on('click', function () {
    // Remove the fade-out class from both #list and #list-list when hiding the fixed column
    $('#list, #list-list').removeClass('fade-out');
    $('#list, #list-list').removeClass('fade-out');
    showArticleWrapper.css('display', 'none');
    closeModal();
        closeModal(this);
        communityFeatured.show();
        communityListFeatured.show();
});
});


     // Revert changes when clicking outside the modal
     // Revert changes when clicking outside the modal
     $(document).on('mousedown', function(event) {
     $(document).on('mousedown', function(event) {
        if (!showArticleWrapper.is(event.target) && showArticleWrapper.has(event.target).length === 0) {
    if (!showArticleWrapper.is(event.target) && showArticleWrapper.has(event.target).length === 0) {
            closeModal(this);
        closeModal();
            communityFeatured.show();
    }
    communityListFeatured.show();
});
        }
    });


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

Navigation menu