MediaWiki:Mobile.js
Appearance
Note: After publishing, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
/* 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);
});
});
});