aboutsummaryrefslogtreecommitdiff
path: root/src/app/js/settings.js
diff options
context:
space:
mode:
author0neGal <mail@0negal.com>2024-12-20 01:55:12 +0100
committerGitHub <noreply@github.com>2024-12-20 01:55:12 +0100
commit14c12f9bf74f7ae7e9b4b873e67b8e9769cdad1e (patch)
tree2a8c0535a22264f4f3d37d684231d2ac147ac199 /src/app/js/settings.js
parentbd4391f737ee4405fc390ab47c4124fe28df48d7 (diff)
parenta8ba1b376ff16a69c52f223341a2ed39fd59a8ea (diff)
downloadViper-14c12f9bf74f7ae7e9b4b873e67b8e9769cdad1e.tar.gz
Viper-14c12f9bf74f7ae7e9b4b873e67b8e9769cdad1e.zip
Merge pull request #239 from 0neGal/gamepad-support
feat: Gamepad/keyboard navigation support
Diffstat (limited to 'src/app/js/settings.js')
-rw-r--r--src/app/js/settings.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/app/js/settings.js b/src/app/js/settings.js
index 3aa9c43..b5ef773 100644
--- a/src/app/js/settings.js
+++ b/src/app/js/settings.js
@@ -286,6 +286,15 @@ settings.popup.load = () => {
}
settings.popup.switch = (el, state) => {
+ if (! el) {return}
+
+ // prevent switches from being switched when disabled
+ if (el.getAttribute("disabled") != null
+ || el.classList.contains("disabled")) {
+
+ return;
+ }
+
if (state) {
return el.classList.add("on");
} else if (state === false) {