Jump to content

MediaWiki:Common.js: Difference between revisions

From stereotool.info
No edit summary
No edit summary
Tag: Manual revert
 
(One intermediate revision by the same user not shown)
(No difference)

Latest revision as of 22:08, 5 February 2025

/* Any JavaScript here will be loaded for all users on every page load. */
mw.loader.using(['jquery']).then(function () {
    // Handle main collapsible sections
    $(".collapsible-header").click(function (e) {
        e.stopPropagation();
        $(this).toggleClass("active");
        $(this).next(".collapsible-content").slideToggle();
    });

    // Handle submenus
    $(".collapsible-subheader").click(function (e) {
        e.stopPropagation();
        $(this).toggleClass("active");
        $(this).next(".collapsible-subcontent").slideToggle();
    });

    // Ensure all submenus are hidden on page load
    $(".collapsible-content, .collapsible-subcontent").hide();
});