bindSimpleSwitch()

This commit is contained in:
Maxim Devaev
2021-08-13 16:39:56 +03:00
parent c233e3bee7
commit 976662df83
4 changed files with 8 additions and 13 deletions

View File

@@ -74,10 +74,7 @@ export function Hid(__getResolution) {
window.addEventListener("pagehide", __releaseAll);
window.addEventListener("blur", __releaseAll);
$("hid-pak-ask-switch").checked = tools.storage.getBool("hid.pak.ask", true);
tools.el.setOnClick($("hid-pak-ask-switch"), function() {
tools.storage.setBool("hid.pak.ask", $("hid-pak-ask-switch").checked);
}, false);
tools.storage.bindSimpleSwitch($("hid-pak-ask-switch"), "hid.pak.ask", true);
$("hid-pak-keymap-selector").addEventListener("change", function() {
tools.storage.set("hid.pak.keymap", $("hid-pak-keymap-selector").value);