More actions
No edit summary |
No edit summary |
||
Line 17: | Line 17: | ||
if (header) { | if (header) { | ||
var section = header.closest('.citizen-section-heading'); | var section = header.closest('.citizen-section-heading'); | ||
if (section && | var content = section?.nextElementSibling; | ||
if (section && content) { | |||
section.classList.add('citizen-section-collapsed'); // manually collapse | |||
content.style.display = "none"; // manually hide content | |||
} | } | ||
} | } |
Revision as of 14:17, 25 April 2025
$(document).ready(function() { if (window.innerWidth >= 768) { // Only on desktop mw.hook('citizen-collapsibles-init').add(function() { const idsToCollapse = [ 'Muling', 'Misc', 'Anti-ban', 'Anti-PK', 'Trip_Settings', 'Skills_Settings', 'Equipment' ]; idsToCollapse.forEach(function(rawId) { var id = rawId.replace(/ /g, "_"); var header = document.getElementById(id); if (header) { var section = header.closest('.citizen-section-heading'); var content = section?.nextElementSibling; if (section && content) { section.classList.add('citizen-section-collapsed'); // manually collapse content.style.display = "none"; // manually hide content } } }); }); } });