mirror of
https://github.com/jakejarvis/dark-mode.git
synced 2025-09-11 05:38:52 -04:00
remove toggle || null
(already checked for)
This commit is contained in:
@@ -22,7 +22,7 @@ const init = function (options) {
|
|||||||
const activateTheme = function (theme, remember) {
|
const activateTheme = function (theme, remember) {
|
||||||
// optional onChange callback function passed as option
|
// optional onChange callback function passed as option
|
||||||
if (typeof options.onChange === "function") {
|
if (typeof options.onChange === "function") {
|
||||||
options.onChange(theme, toggle || null);
|
options.onChange(theme, toggle);
|
||||||
}
|
}
|
||||||
|
|
||||||
document.body.classList.remove(dark, light);
|
document.body.classList.remove(dark, light);
|
||||||
@@ -36,7 +36,7 @@ const init = function (options) {
|
|||||||
|
|
||||||
// optional onInit callback function passed as option
|
// optional onInit callback function passed as option
|
||||||
if (typeof options.onInit === "function") {
|
if (typeof options.onInit === "function") {
|
||||||
options.onInit(toggle || null);
|
options.onInit(toggle);
|
||||||
}
|
}
|
||||||
|
|
||||||
// user has never clicked the button, so go by their OS preference until/if they do so
|
// user has never clicked the button, so go by their OS preference until/if they do so
|
||||||
|
Reference in New Issue
Block a user