Anonymous

MediaWiki:Common.js: Difference between revisions

From Melvor Idle
Move dark mode toggle from document ready and into the global scope
(Try to ensure required icons are available)
(Move dark mode toggle from document ready and into the global scope)
Tag: Reverted
Line 575: Line 575:
setStickyHeaderTop();
setStickyHeaderTop();
$(window).resize(setStickyHeaderTop);
$(window).resize(setStickyHeaderTop);
}
const darkMode = localStorage.getItem('darkMode');
if (darkMode === 'true') {
document.body.classList.add('darkMode');
} else {
document.body.classList.remove('darkMode');
}
}
});
});
Line 600: Line 593:
});
});
} );
} );
const darkMode = localStorage.getItem('darkMode');
if (darkMode === 'true') {
document.body.classList.add('darkMode');
} else {
document.body.classList.remove('darkMode');
}