From ddc1081252d02a2f69f79b9064f5d27270cb45b7 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 14:48:22 +0800 Subject: [PATCH] Removed the "#selector" attribute from the JavaScript BaseAccountOption class. It is only used in the constructor. There is no need to hold a reference to it. --- src/accounting/static/js/account-form.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/accounting/static/js/account-form.js b/src/accounting/static/js/account-form.js index 448b526..11cd6a9 100644 --- a/src/accounting/static/js/account-form.js +++ b/src/accounting/static/js/account-form.js @@ -342,12 +342,6 @@ class BaseAccountSelector { */ class BaseAccountOption { - /** - * The base account selector - * @type {BaseAccountSelector} - */ - #selector; - /** * The element * @type {HTMLLIElement} @@ -379,13 +373,12 @@ class BaseAccountOption { * @param element {HTMLLIElement} the element */ constructor(selector, element) { - this.#selector = selector; this.#element = element; this.code = element.dataset.code; this.text = element.dataset.text; this.#queryValues = JSON.parse(element.dataset.queryValues); - this.#element.onclick = () => this.#selector.form.saveBaseAccount(this); + this.#element.onclick = () => selector.form.saveBaseAccount(this); } /**