aboutsummaryrefslogtreecommitdiff
path: root/frontend/helper.ts
diff options
context:
space:
mode:
authorLia Lenckowski <lialenck@protonmail.com>2023-08-17 19:26:17 +0200
committerLia Lenckowski <lialenck@protonmail.com>2023-08-17 19:26:17 +0200
commitb490f802a83382ad1a255cfef47724a0e7a9789b (patch)
treeb1b7f9dad6bb0884094deb9ecd813d2c9ee76d7f /frontend/helper.ts
parent4fd80f9e24f561bd22f907621dd8901e653f1d25 (diff)
downloadfastbangs-b490f802a83382ad1a255cfef47724a0e7a9789b.tar
fastbangs-b490f802a83382ad1a255cfef47724a0e7a9789b.tar.bz2
fastbangs-b490f802a83382ad1a255cfef47724a0e7a9789b.tar.zst
error handling for login; partial adminpanel infrastructure
Diffstat (limited to 'frontend/helper.ts')
-rw-r--r--frontend/helper.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/frontend/helper.ts b/frontend/helper.ts
index 879d322..827a204 100644
--- a/frontend/helper.ts
+++ b/frontend/helper.ts
@@ -11,14 +11,14 @@ interface Opts<E> {
href?: string,
method?: string,
placeholder?: string,
- onclick?: (e: E) => void,
- onchange?: (e: E) => void,
+ onclick?: (e: Event) => void,
+ onchange?: (e: Event) => void,
}
function apply_opts<E extends HTMLElement>(e: E, o: Opts<E>) {
if (o.id) e.id = o.id
- if (o.onclick) e.onclick = () => o.onclick!(e)
- if (o.onchange) e.onchange = () => o.onchange!(e)
+ if (o.onclick) e.onclick = ev => o.onclick!(ev)
+ if (o.onchange) e.onchange = ev => o.onchange!(ev)
// TODO can we do this properly?
if (o.for) (e as unknown as HTMLLabelElement).htmlFor = o.for
if (o.type && (e instanceof HTMLInputElement || e instanceof HTMLLinkElement)) e.type = o.type