From 1b5e5164134063f7c1d8a8a36d3eddba57e586f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Tue, 28 Feb 2023 22:24:12 +0800 Subject: [PATCH] Renamed the HTML ID and class name prefix of the account selector modal, for consistency. --- src/accounting/static/js/transaction-form.js | 8 ++++---- .../expense/include/form-currency-item.html | 2 +- .../include/account-selector-modal.html | 18 +++++++++--------- .../transaction/include/form-entry-item.html | 2 +- .../income/include/form-currency-item.html | 2 +- .../transfer/include/form-currency-item.html | 4 ++-- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/accounting/static/js/transaction-form.js b/src/accounting/static/js/transaction-form.js index 5f3c051..a07d544 100644 --- a/src/accounting/static/js/transaction-form.js +++ b/src/accounting/static/js/transaction-form.js @@ -255,8 +255,8 @@ function initializeJournalEntryFormModal() { const formAmount = document.getElementById("accounting-entry-form-amount"); const modal = document.getElementById("accounting-entry-form-modal"); formAccountControl.onclick = function () { - const prefix = "accounting-" + entryForm.dataset.entryType + "-account"; - const query = document.getElementById(prefix + "-selector-query") + const prefix = "accounting-account-selector-" + entryForm.dataset.entryType; + const query = document.getElementById(prefix + "-query") const more = document.getElementById(prefix + "-more"); const options = Array.from(document.getElementsByClassName(prefix + "-option")); const btnClear = document.getElementById(prefix + "-btn-clear"); @@ -518,7 +518,7 @@ function initializeAccountSelectors() { * @private */ function initializeAccountQuery(selector) { - const query = document.getElementById(selector.dataset.prefix + "-selector-query"); + const query = document.getElementById(selector.dataset.prefix + "-query"); query.addEventListener("input", function () { filterAccountOptions(selector.dataset.prefix); }); @@ -531,7 +531,7 @@ function initializeAccountQuery(selector) { * @private */ function filterAccountOptions(prefix) { - const query = document.getElementById(prefix + "-selector-query"); + const query = document.getElementById(prefix + "-query"); const optionList = document.getElementById(prefix + "-option-list"); if (optionList === null) { console.log(prefix + "-option-list"); diff --git a/src/accounting/templates/accounting/transaction/expense/include/form-currency-item.html b/src/accounting/templates/accounting/transaction/expense/include/form-currency-item.html index 400e6ba..4cb68d0 100644 --- a/src/accounting/templates/accounting/transaction/expense/include/form-currency-item.html +++ b/src/accounting/templates/accounting/transaction/expense/include/form-currency-item.html @@ -70,7 +70,7 @@ First written: 2023/2/25
- diff --git a/src/accounting/templates/accounting/transaction/include/account-selector-modal.html b/src/accounting/templates/accounting/transaction/include/account-selector-modal.html index b5b6035..5418b20 100644 --- a/src/accounting/templates/accounting/transaction/include/account-selector-modal.html +++ b/src/accounting/templates/accounting/transaction/include/account-selector-modal.html @@ -19,35 +19,35 @@ account-selector-modal.html: The modal for the account selector Author: imacat@mail.imacat.idv.tw (imacat) First written: 2023/2/25 #} -