Removed the originalEntryId parameter from the onOpen method of the JavaScript OriginalEntrySelector class. It can be obtained from the JournalEntryEditor instance, and the parameter is not needed anymore.

This commit is contained in:
依瑪貓 2023-03-19 10:25:33 +08:00
parent 5d0757c845
commit d4b3fe67b9
2 changed files with 3 additions and 4 deletions

View File

@ -239,7 +239,7 @@ class JournalEntryEditor {
this.#summaryEditors = SummaryEditor.getInstances(this); this.#summaryEditors = SummaryEditor.getInstances(this);
this.#accountSelectors = AccountSelector.getInstances(this); this.#accountSelectors = AccountSelector.getInstances(this);
this.originalEntrySelector = new OriginalEntrySelector(this); this.originalEntrySelector = new OriginalEntrySelector(this);
this.#originalEntryControl.onclick = () => this.originalEntrySelector.onOpen(this.originalEntryId) this.#originalEntryControl.onclick = () => this.originalEntrySelector.onOpen()
this.#originalEntryDelete.onclick = () => this.clearOriginalEntry(); this.#originalEntryDelete.onclick = () => this.clearOriginalEntry();
this.#summaryControl.onclick = () => this.#summaryEditors[this.entryType].onOpen(); this.#summaryControl.onclick = () => this.#summaryEditors[this.entryType].onOpen();
this.#accountControl.onclick = () => this.#accountSelectors[this.entryType].onOpen(); this.#accountControl.onclick = () => this.#accountSelectors[this.entryType].onOpen();

View File

@ -176,13 +176,12 @@ class OriginalEntrySelector {
/** /**
* The callback when the original entry selector is shown. * The callback when the original entry selector is shown.
* *
* @param originalEntryId {string|null} the ID of the original entry
*/ */
onOpen(originalEntryId = null) { onOpen() {
this.#currencyCode = this.entryEditor.getCurrencyCode(); this.#currencyCode = this.entryEditor.getCurrencyCode();
this.#entryType = this.entryEditor.entryType; this.#entryType = this.entryEditor.entryType;
for (const option of this.#options) { for (const option of this.#options) {
option.setActive(option.id === originalEntryId); option.setActive(option.id === this.entryEditor.originalEntryId);
} }
this.#query.value = ""; this.#query.value = "";
this.#updateNetBalances(); this.#updateNetBalances();