MediaWiki:Mobile.js: Difference between revisions
Content deleted Content added
No edit summary |
No edit summary Tag: Reverted |
||
Line 160:
}
}, { passive: true });
})();
// CapSach — expand all collapsed sections on the mobile site
(function () {
// Only run on the mobile site (Minerva/MobileFrontend)
if (document.body && !document.body.classList.contains('skin-minerva')) return;
function expandAll() {
// Heuristics that work across MF releases; safe to no-op if nothing matches
var headings = document.querySelectorAll(
'.collapsible-block:not(.open-block) .section-heading,' +
'section[aria-expanded="false"] > .section-heading'
);
headings.forEach(function (h) { h.click(); });
}
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', expandAll);
} else {
expandAll();
}
})();
| |||