diff --git a/src/accounting/static/js/journal-entry-editor.js b/src/accounting/static/js/journal-entry-editor.js index 11df882..38d2661 100644 --- a/src/accounting/static/js/journal-entry-editor.js +++ b/src/accounting/static/js/journal-entry-editor.js @@ -220,7 +220,7 @@ class JournalEntryEditor { this.#amountError = document.getElementById(this.#prefix + "-amount-error"); this.#originalEntryControl.onclick = () => OriginalEntrySelector.start(this, this.originalEntryId); this.#originalEntryDelete.onclick = () => this.clearOriginalEntry(); - this.#summaryControl.onclick = () => SummaryEditor.start(this, this.summary); + this.#summaryControl.onclick = () => SummaryEditor.start(this); this.#accountControl.onclick = () => AccountSelector.start(this, this.entryType); this.#amount.onchange = () => this.#validateAmount(); this.#element.onsubmit = () => { diff --git a/src/accounting/static/js/summary-editor.js b/src/accounting/static/js/summary-editor.js index a538bfe..97e20d8 100644 --- a/src/accounting/static/js/summary-editor.js +++ b/src/accounting/static/js/summary-editor.js @@ -228,12 +228,11 @@ class SummaryEditor { * The callback when the summary editor is shown. * * @param entryEditor {JournalEntryEditor} the journal entry editor - * @param summary {string|null} the summary */ - #onOpen(entryEditor, summary) { + #onOpen(entryEditor) { this.#entryEditor = entryEditor; this.#reset(); - this.summary.value = summary === null? "": summary; + this.summary.value = entryEditor.summary === null? "": entryEditor.summary; this.#onSummaryChange(); } @@ -271,10 +270,9 @@ class SummaryEditor { * The callback when the summary editor is shown. * * @param entryEditor {JournalEntryEditor} the journal entry editor - * @param summary {string|null} the summary */ - static start(entryEditor, summary) { - this.#editors[entryEditor.entryType].#onOpen(entryEditor, summary); + static start(entryEditor) { + this.#editors[entryEditor.entryType].#onOpen(entryEditor); } }