summaryrefslogtreecommitdiff
path: root/static
diff options
context:
space:
mode:
Diffstat (limited to 'static')
-rw-r--r--static/scripts/theme.js19
1 files changed, 11 insertions, 8 deletions
diff --git a/static/scripts/theme.js b/static/scripts/theme.js
index 2ffe621..4bfa68e 100644
--- a/static/scripts/theme.js
+++ b/static/scripts/theme.js
@@ -6,20 +6,23 @@ window.onload = () => {
if(theme == null){
local_storage.setItem('theme', 'dark');
- }
-
- if(theme == 'dark'){
switch_theme.checked = true;
}
else{
- switch_theme.checked = false;
+ if(theme == 'dark'){
+ switch_theme.checked = true;
+ }
+ else{
+ switch_theme.checked = false;
- let theme = document.getElementById('theme-css');
- let href = theme.getAttribute('href');
+ let theme = document.getElementById('theme-css');
+ let href = theme.getAttribute('href');
- href = href.replace('dark.css', 'light.css');
- theme.setAttribute('href', href);
+ href = href.replace('dark.css', 'light.css');
+ theme.setAttribute('href', href);
+ }
}
+
}
function setTheme(){