summaryrefslogtreecommitdiff
path: root/searx/static/themes/simple/src/js
diff options
context:
space:
mode:
authorAlexandre Flament <alex@al-f.net>2021-11-19 17:14:35 +0100
committerGitHub <noreply@github.com>2021-11-19 17:14:35 +0100
commitbc0cf9e83e2b52a45ea9a13ffdace07a622ed0cc (patch)
treea179697bd18097f6368eb14b630aa126cea35857 /searx/static/themes/simple/src/js
parent256ccc4a552ff51a73dc58f33442861870141869 (diff)
parentcf9d161d265ac23cdb1317b8dc878de4235819d3 (diff)
Merge pull request #521 from dalf/simple-theme-style-pref
Simple theme: allow the user to choose auto, light, dark style
Diffstat (limited to 'searx/static/themes/simple/src/js')
-rw-r--r--searx/static/themes/simple/src/js/head/00_init.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/searx/static/themes/simple/src/js/head/00_init.js b/searx/static/themes/simple/src/js/head/00_init.js
index d359a9174..21b1754bf 100644
--- a/searx/static/themes/simple/src/js/head/00_init.js
+++ b/searx/static/themes/simple/src/js/head/00_init.js
@@ -27,5 +27,10 @@
};
// update the css
- d.getElementsByTagName("html")[0].className = (w.searxng.touch)?"js touch":"js";
+ var hmtlElement = d.getElementsByTagName("html")[0];
+ hmtlElement.classList.remove('no-js');
+ hmtlElement.classList.add('js');
+ if (w.searxng.touch) {
+ hmtlElement.classList.add('touch');
+ }
})(window, document); \ No newline at end of file