aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author0neGal <mail@0negal.com>2023-03-09 16:33:03 +0100
committer0neGal <mail@0negal.com>2023-03-09 16:33:24 +0100
commitb4f473a45ab1b8ea29aa6c0818bdedf082a816ab (patch)
treea8adbe249a970a9a1d91bc4a606a4fa7b4b3da10
parentaad6ce75b752a7300266322019aa2cb72a2b9c3e (diff)
downloadViper-b4f473a45ab1b8ea29aa6c0818bdedf082a816ab.tar.gz
Viper-b4f473a45ab1b8ea29aa6c0818bdedf082a816ab.zip
fixed changing language not disabling autolang
-rw-r--r--src/app/js/settings.js15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/app/js/settings.js b/src/app/js/settings.js
index 645a9ed..20cd4b6 100644
--- a/src/app/js/settings.js
+++ b/src/app/js/settings.js
@@ -99,14 +99,23 @@ var Settings = {
ipcRenderer.on("cant-autoupdate", () => {
document.querySelector(".option[name=autoupdate]").style.display = "none";
})
+ },
+ switch: (el, state) => {
+ if (state) {
+ return el.classList.add("on");
+ } else if (state === false) {
+ return el.classList.remove("on");
+ }
+
+ if (el.classList.contains("switch") && el.tagName == "BUTTON") {
+ el.classList.toggle("on");
+ }
}
}
document.body.addEventListener("click", (e) => {
let el = document.elementFromPoint(e.clientX, e.clientY);
- if (el.classList.contains("switch") && el.tagName == "BUTTON") {
- el.classList.toggle("on");
- }
+ Settings.switch(el);
})
Settings.load();