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) {
const closeButtons = Array.from(document.getElementsByClassName(this.#prefix + "-close"));
closeButtons.forEach(function (button) {
for (const button of closeButtons) {
if (isNew) {
button.dataset.bsTarget = "";
button.dataset.bsTarget = "#" + this.#prefix + "-modal";
} else {
button.dataset.bsTarget = "#accounting-entry-form-modal";
}
});
}
this.#reset();
if (!isNew) {
this.#populate();