Added the #prefix property to the journal entry editor to simplify the consistency.

This commit is contained in:
依瑪貓 2023-03-13 18:40:15 +08:00
parent b3c666c872
commit b344abce06

View File

@ -800,6 +800,12 @@ class JournalEntryEditor {
*/ */
entryType; entryType;
/**
* The prefix of the HTML ID and class
* @type {string}
*/
#prefix = "accounting-entry-editor"
/** /**
* The control of the account * The control of the account
* @type {HTMLDivElement} * @type {HTMLDivElement}
@ -865,16 +871,16 @@ class JournalEntryEditor {
* *
*/ */
constructor() { constructor() {
this.#element = document.getElementById("accounting-entry-editor"); this.#element = document.getElementById(this.#prefix);
this.#modal = document.getElementById("accounting-entry-editor-modal"); this.#modal = document.getElementById(this.#prefix + "-modal");
this.#accountControl = document.getElementById("accounting-entry-editor-account-control"); this.#accountControl = document.getElementById(this.#prefix + "-account-control");
this.#account = document.getElementById("accounting-entry-editor-account"); this.#account = document.getElementById(this.#prefix + "-account");
this.#accountError = document.getElementById("accounting-entry-editor-account-error") this.#accountError = document.getElementById(this.#prefix + "-account-error")
this.#summaryControl = document.getElementById("accounting-entry-editor-summary-control"); this.#summaryControl = document.getElementById(this.#prefix + "-summary-control");
this.#summary = document.getElementById("accounting-entry-editor-summary"); this.#summary = document.getElementById(this.#prefix + "-summary");
this.#summaryError = document.getElementById("accounting-entry-editor-summary-error"); this.#summaryError = document.getElementById(this.#prefix + "-summary-error");
this.#amount = document.getElementById("accounting-entry-editor-amount"); this.#amount = document.getElementById(this.#prefix + "-amount");
this.#amountError = document.getElementById("accounting-entry-editor-amount-error"); this.#amountError = document.getElementById(this.#prefix + "-amount-error");
this.#summaryControl.onclick = () => { this.#summaryControl.onclick = () => {
SummaryEditor.start(this, this.#summary.dataset.value); SummaryEditor.start(this, this.#summary.dataset.value);
}; };