Replaces the datasets with object attributes to store the column values in the JavaScript JournalEntryEditor class.

This commit is contained in:
2023-03-18 10:41:17 +08:00
committed by 依瑪貓
parent 0a1bbbdd47
commit 94a527caf2
5 changed files with 97 additions and 72 deletions

View File

@ -151,8 +151,8 @@ class AccountSelector {
*/
#getCodesUsedInForm() {
const inUse = this.#entryEditor.getTransactionForm().getAccountCodesUsed(this.#entryType);
if (this.#entryEditor.getAccountCode() !== null) {
inUse.push(this.#entryEditor.getAccountCode());
if (this.#entryEditor.accountCode !== null) {
inUse.push(this.#entryEditor.accountCode);
}
return inUse
}
@ -199,13 +199,13 @@ class AccountSelector {
this.#more.classList.remove("d-none");
this.#filterOptions();
for (const option of this.#options) {
if (option.dataset.code === entryEditor.getAccountCode()) {
if (option.dataset.code === entryEditor.accountCode) {
option.classList.add("active");
} else {
option.classList.remove("active");
}
}
if (entryEditor.getAccountCode() === null) {
if (entryEditor.accountCode === null) {
this.#clearButton.classList.add("btn-secondary");
this.#clearButton.classList.remove("btn-danger");
this.#clearButton.disabled = true;