From 0da4d19ec0d0bc0d63bb615bc1e642bb6aeecd31 Mon Sep 17 00:00:00 2001 From: 0neGal Date: Sat, 15 Jun 2024 23:47:57 +0200 Subject: prevent gamepad from toggling disabled switches --- src/app/js/settings.js | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/app/js/settings.js') diff --git a/src/app/js/settings.js b/src/app/js/settings.js index 3addf0e..d57dfc7 100644 --- a/src/app/js/settings.js +++ b/src/app/js/settings.js @@ -251,6 +251,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) { -- cgit v1.2.3