MediaWiki:Common.js: Difference between revisions

From Arcis Wiki
Created page with "→‎Any JavaScript here will be loaded for all users on every page load.: →‎Enable collapsing/expanding functionality: document.addEventListener('DOMContentLoaded', function () { var tocHeader = document.querySelector('.toc h2'); var tocContent = document.querySelector('.toc .toc-content'); if (tocHeader && tocContent) { tocHeader.addEventListener('click', function () { tocContent.style.display = (tocContent.style.display === 'block')..."
 
mNo edit summary
Line 1: Line 1:
/* Any JavaScript here will be loaded for all users on every page load. */
/* Any JavaScript here will be loaded for all users on every page load. */
/* Enable collapsing/expanding functionality */
document.addEventListener('DOMContentLoaded', function () {
    var tocHeader = document.querySelector('.toc h2');
    var tocContent = document.querySelector('.toc .toc-content');
    if (tocHeader && tocContent) {
        tocHeader.addEventListener('click', function () {
            tocContent.style.display = (tocContent.style.display === 'block') ? 'none' : 'block';
        });
    }
});

Revision as of 22:45, 23 October 2024

/* Any JavaScript here will be loaded for all users on every page load. */