More actions
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
$(document).ready(function() { | $(document).ready(function() { | ||
if (window.innerWidth >= 768) { // Only on desktop | if (window.innerWidth >= 768) { // Only on desktop | ||
const idsToCollapse = ['Muling', 'Misc', 'Anti-ban', 'Anti-PK', 'Trip_Settings', 'Skills_Settings', 'Equipment']; | const idsToCollapse = [ | ||
'Muling', | |||
'Misc', | |||
'Anti-ban', | |||
'Anti-PK', | |||
'Trip_Settings', | |||
'Skills_Settings', | |||
'Equipment' | |||
]; | |||
idsToCollapse.forEach(function(rawId) { | idsToCollapse.forEach(function(rawId) { | ||
var id = rawId.replace(/ /g, "_"); | var id = rawId.replace(/ /g, "_"); | ||
var header = document.getElementById(id); | var header = document.getElementById(id); | ||
if (header) { | if (header) { | ||
var section = header.closest('.citizen-section-heading'); | var section = header.closest('.citizen-section-heading'); | ||
if (section && !section.classList.contains('citizen-section-collapsed')) { | |||
if (section && | // Simulate a click on the header to collapse it | ||
section.click(); | |||
} | } | ||
} | } | ||
}); | }); | ||
} | } | ||
}); | }); | ||
Revision as of 14:13, 25 April 2025
$(document).ready(function() {
if (window.innerWidth >= 768) { // Only on desktop
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');
if (section && !section.classList.contains('citizen-section-collapsed')) {
// Simulate a click on the header to collapse it
section.click();
}
}
});
}
});