From a36e3aa3a4a5fe33836d3051d2aa636ca67f45b8 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sun, 6 Jun 2021 19:28:16 +0200 Subject: [PATCH] web: rename Form.reset to resetForm to prevent t.form is not a function error Signed-off-by: Jens Langhammer --- web/src/elements/buttons/ModalButton.ts | 2 +- web/src/elements/forms/Form.ts | 2 +- web/src/elements/forms/ModalForm.ts | 2 +- web/src/elements/forms/ProxyForm.ts | 4 ++-- web/src/elements/table/TableModal.ts | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/web/src/elements/buttons/ModalButton.ts b/web/src/elements/buttons/ModalButton.ts index b90070ff5..b65be243c 100644 --- a/web/src/elements/buttons/ModalButton.ts +++ b/web/src/elements/buttons/ModalButton.ts @@ -55,7 +55,7 @@ export class ModalButton extends LitElement { resetForms(): void { this.querySelectorAll("[slot=form]").forEach(form => { - form?.reset(); + form?.resetForm(); }); } diff --git a/web/src/elements/forms/Form.ts b/web/src/elements/forms/Form.ts index 42ff7bc08..2d19c7cb8 100644 --- a/web/src/elements/forms/Form.ts +++ b/web/src/elements/forms/Form.ts @@ -79,7 +79,7 @@ export class Form extends LitElement { /** * Reset the inner iron-form */ - reset(): void { + resetForm(): void { const ironForm = this.shadowRoot?.querySelector("iron-form"); ironForm?.reset(); } diff --git a/web/src/elements/forms/ModalForm.ts b/web/src/elements/forms/ModalForm.ts index 87913f9a3..6510e85f6 100644 --- a/web/src/elements/forms/ModalForm.ts +++ b/web/src/elements/forms/ModalForm.ts @@ -23,7 +23,7 @@ export class ModalForm extends ModalButton { return formPromise.then(() => { if (this.closeAfterSuccessfulSubmit) { this.open = false; - form?.reset(); + form?.resetForm(); } this.dispatchEvent( new CustomEvent(EVENT_REFRESH, { diff --git a/web/src/elements/forms/ProxyForm.ts b/web/src/elements/forms/ProxyForm.ts index e2b19536b..45f1f9d5f 100644 --- a/web/src/elements/forms/ProxyForm.ts +++ b/web/src/elements/forms/ProxyForm.ts @@ -17,8 +17,8 @@ export class ProxyForm extends Form { return (this.shadowRoot?.firstElementChild as Form).submit(ev); } - reset(): void { - (this.shadowRoot?.firstElementChild as Form | undefined)?.reset(); + resetForm(): void { + (this.shadowRoot?.firstElementChild as Form | undefined)?.resetForm(); } getSuccessMessage(): string { diff --git a/web/src/elements/table/TableModal.ts b/web/src/elements/table/TableModal.ts index ca940b17e..1dae0bda9 100644 --- a/web/src/elements/table/TableModal.ts +++ b/web/src/elements/table/TableModal.ts @@ -34,7 +34,7 @@ export abstract class TableModal extends Table { resetForms(): void { this.querySelectorAll("[slot=form]").forEach(form => { - form?.reset(); + form?.resetForm(); }); }