summaryrefslogtreecommitdiff
path: root/web/kbn_assets/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/kbn_assets/app.js')
-rw-r--r--web/kbn_assets/app.js17
1 files changed, 15 insertions, 2 deletions
diff --git a/web/kbn_assets/app.js b/web/kbn_assets/app.js
index 82b2db1..86504cd 100644
--- a/web/kbn_assets/app.js
+++ b/web/kbn_assets/app.js
@@ -102,7 +102,7 @@ function removeClass(el, name) {
}
function indexInit() {
- var blocks = ['zones', 'all'];
+ var blocks = ['zones', 'list'];
for (var i = 0; i < blocks.length; i++) {
var button = ge('cam_'+blocks[i]+'_btn');
button.addEventListener('click', function(e) {
@@ -260,4 +260,17 @@ var Inverter = {
}
});
}
-}; \ No newline at end of file
+};
+
+(function () {
+ var htmlElement = document.querySelector("html")
+ if (htmlElement.getAttribute("data-bs-theme") === 'auto') {
+ function updateTheme() {
+ document.querySelector("html").setAttribute("data-bs-theme", window.matchMedia("(prefers-color-scheme: dark)").matches
+ ? "dark"
+ : "light")
+ }
+ window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', updateTheme);
+ updateTheme();
+ }
+})()