Renamed the HTML ID and class name prefix of the account selector modal, for consistency.

This commit is contained in:
2023-02-28 22:24:12 +08:00
parent 20cb5cecc4
commit 1b5e516413
6 changed files with 18 additions and 18 deletions

View File

@ -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");