MediaWiki:Common.js: Difference between revisions

m
Reverted edits by Malcs (talk) to last revision by Auron956
(Move dark mode toggle from document ready and into the global scope)
Tag: Reverted
m (Reverted edits by Malcs (talk) to last revision by Auron956)
Tag: Rollback
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 593: Line 600:
});
});
} );
} );
const darkMode = localStorage.getItem('darkMode');
if (darkMode === 'true') {
document.body.classList.add('darkMode');
} else {
document.body.classList.remove('darkMode');
}