mirror of
https://codeberg.org/metamuffin/abrechenbarkeit.git
synced 2025-01-30 18:51:41 +00:00
fix missing local
This commit is contained in:
parent
5f8b7352cd
commit
2494afa73e
2 changed files with 6 additions and 1 deletions
|
@ -224,6 +224,7 @@ local function r_user_post(username)
|
||||||
local pcode = nil
|
local pcode = nil
|
||||||
local pcount = nil
|
local pcount = nil
|
||||||
local powner = nil
|
local powner = nil
|
||||||
|
local powner_comment = nil
|
||||||
if data.pcode then
|
if data.pcode then
|
||||||
for p_barcode, p_amount, p_name, p_owner in read_products() do
|
for p_barcode, p_amount, p_name, p_owner in read_products() do
|
||||||
if p_barcode == data.pcode then
|
if p_barcode == data.pcode then
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
/// <reference lib="dom" />
|
/// <reference lib="dom" />
|
||||||
|
|
||||||
document.addEventListener("keydown", ev => {
|
document.addEventListener("keydown", ev => {
|
||||||
|
if (ev.ctrlKey || ev.altKey) return
|
||||||
if (!(document.activeElement instanceof HTMLInputElement)) {
|
if (!(document.activeElement instanceof HTMLInputElement)) {
|
||||||
if (ev.code.startsWith("Digit")) {
|
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)
|
return document.forms.buy_product.pcode.value += ev.code.substring(5)
|
||||||
} else if (ev.code == "Enter") {
|
} else if (ev.code == "Enter") {
|
||||||
if (document.forms.buy_product)
|
if (document.forms.buy_product)
|
||||||
|
@ -16,6 +17,9 @@ document.addEventListener("keydown", ev => {
|
||||||
} else if (ev.code == "Backspace") {
|
} else if (ev.code == "Backspace") {
|
||||||
if (document.forms.user_creation)
|
if (document.forms.user_creation)
|
||||||
return document.forms.user_creation.create_user.value = ""
|
return document.forms.user_creation.create_user.value = ""
|
||||||
|
} else if (ev.code == "Escape") {
|
||||||
|
window.location.href = "/"
|
||||||
|
ev.preventDefault()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Reference in a new issue