diff --git a/wowchemy/assets/js/academic.js b/wowchemy/assets/js/academic.js index 0ed7574d..181abe22 100644 --- a/wowchemy/assets/js/academic.js +++ b/wowchemy/assets/js/academic.js @@ -336,9 +336,10 @@ * Change Theme Mode (0: Day, 1: Night, 2: Auto). * --------------------------------------------------------------------------- */ + // TODO: import theme functions from load-theme.js to avoid duplication. function canChangeTheme() { - // If the theme changer component is present, then user is allowed to change the theme variation. - return $('.js-theme-selector').length; + // If var is set, then user is allowed to change the theme variation. + return Boolean(window.wcDarkLightEnabled); } function getThemeMode() { diff --git a/wowchemy/assets/js/load-theme.js b/wowchemy/assets/js/load-theme.js index 748214e2..f7bb6f31 100644 --- a/wowchemy/assets/js/load-theme.js +++ b/wowchemy/assets/js/load-theme.js @@ -5,7 +5,7 @@ function canChangeTheme() { // If var is set, then user is allowed to change the theme variation. - return Boolean(window.staDarkLightChooser); + return Boolean(window.wcDarkLightEnabled); } function initThemeVariation() { diff --git a/wowchemy/layouts/_default/baseof.html b/wowchemy/layouts/_default/baseof.html index 80366aa0..2e974d76 100644 --- a/wowchemy/layouts/_default/baseof.html +++ b/wowchemy/layouts/_default/baseof.html @@ -11,7 +11,7 @@ {{/* Load day/night theme. */}} {{/* Initialise default theme. */}} {{ if site.Params.day_night }} - + {{ end }} {{ if eq (.Scratch.Get "light") true }} diff --git a/wowchemy/layouts/partials/navbar.html b/wowchemy/layouts/partials/navbar.html index c39a203d..258d8e6b 100644 --- a/wowchemy/layouts/partials/navbar.html +++ b/wowchemy/layouts/partials/navbar.html @@ -139,7 +139,8 @@