summaryrefslogtreecommitdiffstats
path: root/layouts/partials/scripts-front.html
diff options
context:
space:
mode:
authoramzrk22020-05-31 16:31:27 +0800
committeramzrk22020-05-31 16:31:27 +0800
commit8009dfd8f5d33211a07d01319715fc3993979138 (patch)
tree5effe87db759b4bd2d62e0abeb170c2eca900428 /layouts/partials/scripts-front.html
parentbde0e702941721e0f408390478a1f497cf8a7a31 (diff)
downloadhugo-theme-fuji-8009dfd8f5d33211a07d01319715fc3993979138.tar.gz
hugo-theme-fuji-8009dfd8f5d33211a07d01319715fc3993979138.tar.bz2
hugo-theme-fuji-8009dfd8f5d33211a07d01319715fc3993979138.zip
Scripts adjustment
Diffstat (limited to 'layouts/partials/scripts-front.html')
-rw-r--r--layouts/partials/scripts-front.html6
1 files changed, 2 insertions, 4 deletions
diff --git a/layouts/partials/scripts-front.html b/layouts/partials/scripts-front.html
index 59c3bb0..9425769 100644
--- a/layouts/partials/scripts-front.html
+++ b/layouts/partials/scripts-front.html
@@ -1,6 +1,6 @@
<script data-cfasync="false">
// detect theme data in localStorage
- // change the data-theme attribute of body
+ // if diff change the data-theme attribute of body
var fujiThemeData = localStorage.getItem('fuji_theme');
if (fujiThemeData) {
if ($('body').attr('data-theme') !== fujiThemeData) {
@@ -12,12 +12,10 @@
}
});
}
- } else {
- localStorage.setItem('fuji_theme', $('body').attr('data-theme'));
}
</script>
<script data-cfasync="false">
- // ie
+ // ie detection
var ua = window.navigator.userAgent;
function browserDetection() {