From 4299fd6fbdfdd92a22d2c94b4eaf96ee3219736d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Sat, 11 Mar 2023 23:36:07 +0800 Subject: [PATCH] Revised the code in the JavaScript initializeBaseAccountSelector function in the account form. --- src/accounting/static/js/account-form.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/accounting/static/js/account-form.js b/src/accounting/static/js/account-form.js index a388a6b..f2b3fe9 100644 --- a/src/accounting/static/js/account-form.js +++ b/src/accounting/static/js/account-form.js @@ -47,7 +47,7 @@ function initializeBaseAccountSelector() { const isOffsetNeeded = document.getElementById("accounting-is-offset-needed"); const options = Array.from(document.getElementsByClassName("accounting-base-option")); const btnClear = document.getElementById("accounting-btn-clear-base"); - selector.addEventListener("show.bs.modal", () => { + base.onclick = () => { base.classList.add("accounting-not-empty"); for (const option of options) { option.classList.remove("active"); @@ -56,7 +56,7 @@ function initializeBaseAccountSelector() { if (selected !== null) { selected.classList.add("active"); } - }); + }; selector.addEventListener("hidden.bs.modal", () => { if (baseCode.value === "") { base.classList.remove("accounting-not-empty");