From c9453d3023c8f94b86f2ac955cb2c1c508b8014e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Sat, 18 Mar 2023 18:04:23 +0800 Subject: [PATCH] Removed the redundant "entryType" parameter from the static "start" method of JavaScript AccountSelector. --- src/accounting/static/js/account-selector.js | 5 ++--- src/accounting/static/js/journal-entry-editor.js | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/accounting/static/js/account-selector.js b/src/accounting/static/js/account-selector.js index f8e1cac..897c38e 100644 --- a/src/accounting/static/js/account-selector.js +++ b/src/accounting/static/js/account-selector.js @@ -234,9 +234,8 @@ class AccountSelector { * Starts the account selector. * * @param entryEditor {JournalEntryEditor} the journal entry editor - * @param entryType {string} the entry type, either "debit" or "credit" */ - static start(entryEditor, entryType) { - this.#selectors[entryType].#onOpen(entryEditor); + static start(entryEditor) { + this.#selectors[entryEditor.entryType].#onOpen(entryEditor); } } diff --git a/src/accounting/static/js/journal-entry-editor.js b/src/accounting/static/js/journal-entry-editor.js index 38d2661..d913ba9 100644 --- a/src/accounting/static/js/journal-entry-editor.js +++ b/src/accounting/static/js/journal-entry-editor.js @@ -221,7 +221,7 @@ class JournalEntryEditor { this.#originalEntryControl.onclick = () => OriginalEntrySelector.start(this, this.originalEntryId); this.#originalEntryDelete.onclick = () => this.clearOriginalEntry(); this.#summaryControl.onclick = () => SummaryEditor.start(this); - this.#accountControl.onclick = () => AccountSelector.start(this, this.entryType); + this.#accountControl.onclick = () => AccountSelector.start(this); this.#amount.onchange = () => this.#validateAmount(); this.#element.onsubmit = () => { if (this.#validate()) {