fix missing local

This commit is contained in:
metamuffin 2024-11-04 16:24:41 +01:00
parent 5f8b7352cd
commit 2494afa73e
No known key found for this signature in database
GPG key ID: 718F9749DCDBD654
2 changed files with 6 additions and 1 deletions

View file

@ -224,6 +224,7 @@ local function r_user_post(username)
local pcode = nil
local pcount = nil
local powner = nil
local powner_comment = nil
if data.pcode then
for p_barcode, p_amount, p_name, p_owner in read_products() do
if p_barcode == data.pcode then

View file

@ -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()
}
}
})