User:Canadabonk/common.js: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 14:
const
$body = $('body'),
$html = $document.getElementsByTagName('html')[0];
 
if (localStorage.ctDarkMode == 'true') {
$html.addClassclassList.add('cosmostweaks-darkmode');
}
if (localStorage.ctFullwide == 'true') {
$html.addClassclassList.add('fullwide');
}
 
Line 37:
$('#mw-content').prepend('<div class="ct-sidetools-wrapper"><div class="ct-sidetools"></div></div>');
const sidetools = $('.ct-sidetools');
$(window).resize(function(){
if ($(window).width() < 850) {
sidetools.hide();
} else {
sidetools.show();
}
});
 
// if toc exists, add toc to sidetools
251

edits