From b68684e1e524da775f0ac2ab373cbb4431704075 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Thu, 2 Jun 2022 18:54:19 +0200 Subject: [PATCH] Incorrect tracking of open page overlays Calling this method (implicitly) while the dialog is still open causes the same dialog to be counted multiple times. See https://www.woltlab.com/community/thread/295827-boxen-im-benutzerprofil/ --- ts/WoltLabSuite/Core/Ui/Dialog.ts | 4 +++- wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Dialog.js | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ts/WoltLabSuite/Core/Ui/Dialog.ts b/ts/WoltLabSuite/Core/Ui/Dialog.ts index cebda856bf..6b548b888e 100644 --- a/ts/WoltLabSuite/Core/Ui/Dialog.ts +++ b/ts/WoltLabSuite/Core/Ui/Dialog.ts @@ -230,7 +230,9 @@ const UiDialog = { * element will be appended to the content element instead. */ openStatic(id: string, html: DialogHtml, options?: DialogOptions): DialogData { - UiScreen.pageOverlayOpen(); + if (!this.isOpen(id)) { + UiScreen.pageOverlayOpen(); + } if (Environment.platform() !== "desktop") { if (!this.isOpen(id)) { diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Dialog.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Dialog.js index b7600c94bb..3944bbc6a5 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Dialog.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Dialog.js @@ -188,7 +188,9 @@ define(["require", "exports", "tslib", "../Core", "../Dom/Change/Listener", "./S * element will be appended to the content element instead. */ openStatic(id, html, options) { - UiScreen.pageOverlayOpen(); + if (!this.isOpen(id)) { + UiScreen.pageOverlayOpen(); + } if (Environment.platform() !== "desktop") { if (!this.isOpen(id)) { UiScreen.scrollDisable(); -- 2.20.1