Skip to content

Commit

Permalink
prevent gamepad from toggling disabled switches
Browse files Browse the repository at this point in the history
  • Loading branch information
0neGal committed Jun 15, 2024
1 parent a3665ec commit 0da4d19
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/app/js/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 0da4d19

Please sign in to comment.