web/admin: migrate application form to web

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer
2021-03-29 21:29:27 +02:00
parent 657b0089b1
commit 03ff495011
13 changed files with 221 additions and 166 deletions

View File

@ -54,11 +54,18 @@ export class ModalButton extends LitElement {
super();
window.addEventListener("keyup", (e) => {
if (e.code === "Escape") {
this.resetForms();
this.open = false;
}
});
}
resetForms(): void {
this.querySelectorAll<HTMLFormElement>("[slot=form]").forEach(form => {
form.reset();
});
}
updateHandlers(): void {
// Ensure links close the modal
this.shadowRoot?.querySelectorAll<HTMLAnchorElement>("a").forEach((a) => {