diff options
author | metamuffin <metamuffin@disroot.org> | 2024-11-04 16:24:41 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-11-04 16:24:41 +0100 |
commit | 2494afa73ec954b321a004b124346de6f2d4f5ab (patch) | |
tree | 9aa70225e4f28680337ee18c08f93e75b8c5fab2 /script.js | |
parent | 5f8b7352cd5231bc1151c3b3f5aaaef261747253 (diff) | |
download | abrechenbarkeit-2494afa73ec954b321a004b124346de6f2d4f5ab.tar abrechenbarkeit-2494afa73ec954b321a004b124346de6f2d4f5ab.tar.bz2 abrechenbarkeit-2494afa73ec954b321a004b124346de6f2d4f5ab.tar.zst |
fix missing local
Diffstat (limited to 'script.js')
-rw-r--r-- | script.js | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -1,9 +1,10 @@ /// <reference lib="dom" /> document.addEventListener("keydown", ev => { + if (ev.ctrlKey || ev.altKey) return if (!(document.activeElement instanceof HTMLInputElement)) { if (ev.code.startsWith("Digit")) { - if (document.forms.buy_product.pcode) + if (document.forms.buy_product) return document.forms.buy_product.pcode.value += ev.code.substring(5) } else if (ev.code == "Enter") { if (document.forms.buy_product) @@ -16,6 +17,9 @@ document.addEventListener("keydown", ev => { } else if (ev.code == "Backspace") { if (document.forms.user_creation) return document.forms.user_creation.create_user.value = "" + } else if (ev.code == "Escape") { + window.location.href = "/" + ev.preventDefault() } } }) |