Jump to content

MediaWiki:Mobile.js: Difference between revisions

From WikiHikmah
Created page with "All JavaScript here will be loaded for users of the mobile site: document.addEventListener('DOMContentLoaded', function () { function syncSectionChevrons() { document.querySelectorAll('.section-heading .indicator.mf-icon').forEach(function (el) { var heading = el.closest('.section-heading'); var isOpen = heading && heading.classList.contains('open-block'); el.textContent = isOpen ? '▾' : '▸'; el.style.display = 'inline-block'; el.style.width =..."
 
Tag: Replaced
 
Line 1: Line 1:
/* All JavaScript here will be loaded for users of the mobile site */
/* All JavaScript here will be loaded for users of the mobile site */
document.addEventListener('DOMContentLoaded', function () {
function syncSectionChevrons() {
document.querySelectorAll('.section-heading .indicator.mf-icon').forEach(function (el) {
var heading = el.closest('.section-heading');
var isOpen = heading && heading.classList.contains('open-block');
el.textContent = isOpen ? '▾' : '▸';
el.style.display = 'inline-block';
el.style.width = '1.2em';
el.style.marginRight = '0.35em';
el.style.fontSize = '1.1em';
el.style.lineHeight = '1';
el.style.verticalAlign = 'middle';
el.style.color = '#202122';
el.style.background = 'none';
});
}
syncSectionChevrons();
document.querySelectorAll('.section-heading').forEach(function (heading) {
heading.addEventListener('click', function () {
setTimeout(syncSectionChevrons, 0);
});
});
});

Latest revision as of 22:42, 17 April 2026

/* All JavaScript here will be loaded for users of the mobile site */