MediaWiki:Common.js: Difference between revisions

From EstoriaRO Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 9: Line 9:
     setTimeout(forceSidebarOpen, 300);
     setTimeout(forceSidebarOpen, 300);
     setTimeout(forceSidebarOpen, 800);
     setTimeout(forceSidebarOpen, 800);
});
document.querySelectorAll('#mw-panel .portal h3').forEach(h => {
    h.style.cursor = 'pointer';
    h.addEventListener('click', () => {
        const content = h.nextElementSibling;
        content.style.display =
            content.style.display === 'none' ? 'block' : 'none';
    });
});
});

Revision as of 02:31, 19 December 2025

mw.loader.using('mediawiki.util').then(() => {
    function forceSidebarOpen() {
        document.querySelectorAll('.vector-menu-checkbox').forEach(cb => {
            cb.checked = true;
        });
    }

    forceSidebarOpen();
    setTimeout(forceSidebarOpen, 300);
    setTimeout(forceSidebarOpen, 800);
});


document.querySelectorAll('#mw-panel .portal h3').forEach(h => {
    h.style.cursor = 'pointer';
    h.addEventListener('click', () => {
        const content = h.nextElementSibling;
        content.style.display =
            content.style.display === 'none' ? 'block' : 'none';
    });
});