From fa3cdace7f581ca86714d0ffce9fdddf70acd0e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Wed, 22 Mar 2023 11:22:46 +0800 Subject: [PATCH] Renamed the #validateForm method to #validate in the JavaScript AccountForm and CurrencyForm. --- src/accounting/static/js/account-form.js | 4 ++-- src/accounting/static/js/currency-form.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/accounting/static/js/account-form.js b/src/accounting/static/js/account-form.js index 88fda14..edd8449 100644 --- a/src/accounting/static/js/account-form.js +++ b/src/accounting/static/js/account-form.js @@ -110,7 +110,7 @@ class AccountForm { this.#isNeedOffsetControl = document.getElementById("accounting-is-need-offset-control"); this.#isNeedOffset = document.getElementById("accounting-is-need-offset"); this.#formElement.onsubmit = () => { - return this.#validateForm(); + return this.#validate(); }; this.#baseControl.onclick = () => { this.#baseControl.classList.add("accounting-not-empty"); @@ -163,7 +163,7 @@ class AccountForm { * * @returns {boolean} true if valid, or false otherwise */ - #validateForm() { + #validate() { let isValid = true; isValid = this.#validateBase() && isValid; isValid = this.#validateTitle() && isValid; diff --git a/src/accounting/static/js/currency-form.js b/src/accounting/static/js/currency-form.js index c81ae8d..c6d61c1 100644 --- a/src/accounting/static/js/currency-form.js +++ b/src/accounting/static/js/currency-form.js @@ -81,7 +81,7 @@ class CurrencyForm { this.#validateName(); }; this.#formElement.onsubmit = () => { - this.#validateForm().then((isValid) => { + this.#validate().then((isValid) => { if (isValid) { this.#formElement.submit(); } @@ -95,7 +95,7 @@ class CurrencyForm { * * @returns {Promise} true if valid, or false otherwise */ - async #validateForm() { + async #validate() { let isValid = true; isValid = await this.#validateCode() && isValid; isValid = this.#validateName() && isValid;