Fixed the target in the initShow method of the JavaScript summary helper.

This commit is contained in:
依瑪貓 2023-02-28 19:13:08 +08:00
parent 8b77d9ff93
commit 2bd0f0f14d

View File

@ -643,13 +643,13 @@ class SummaryHelper {
*/ */
initShow(isNew) { initShow(isNew) {
const closeButtons = Array.from(document.getElementsByClassName(this.#prefix + "-close")); const closeButtons = Array.from(document.getElementsByClassName(this.#prefix + "-close"));
closeButtons.forEach(function (button) { for (const button of closeButtons) {
if (isNew) { if (isNew) {
button.dataset.bsTarget = ""; button.dataset.bsTarget = "#" + this.#prefix + "-modal";
} else { } else {
button.dataset.bsTarget = "#accounting-entry-form-modal"; button.dataset.bsTarget = "#accounting-entry-form-modal";
} }
}); }
this.#reset(); this.#reset();
if (!isNew) { if (!isNew) {
this.#populate(); this.#populate();