From c3fc6d9a87568d12c34f56e332e2ec0c6349b97e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Mon, 3 Apr 2023 10:37:15 +0800 Subject: [PATCH] Revised the onOpen method of the JavaScript DescriptionEditor editor, to clear the tab planes after the confirmed account is set, so that it works in an environment where the confirmed account is already set. --- src/accounting/static/js/description-editor.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/accounting/static/js/description-editor.js b/src/accounting/static/js/description-editor.js index 42301b7..b36dbbc 100644 --- a/src/accounting/static/js/description-editor.js +++ b/src/accounting/static/js/description-editor.js @@ -303,8 +303,11 @@ class DescriptionEditor { */ onOpen() { this.description = this.lineItemEditor.description === null? "": this.lineItemEditor.description; - this.#onDescriptionChange(); this.#setConfirmedAccount(); + this.#onDescriptionChange(); + if (this.#isAccountConfirmed) { + this.selectAccount(this.#confirmedAccount); + } } /** @@ -320,7 +323,6 @@ class DescriptionEditor { } else { this.#confirmedAccount = null; } - this.selectAccount(this.#confirmedAccount); } /**