From c05bd488ebc24d6d2c52519383d6ce2f1b0d6cb4 Mon Sep 17 00:00:00 2001 From: Cyperghost Date: Mon, 15 Jan 2024 15:01:05 +0100 Subject: [PATCH] Close overlays after tab change --- ts/WoltLabSuite/Core/Ui/TabMenu/Simple.ts | 2 ++ .../install/files/js/WoltLabSuite/Core/Ui/TabMenu/Simple.js | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ts/WoltLabSuite/Core/Ui/TabMenu/Simple.ts b/ts/WoltLabSuite/Core/Ui/TabMenu/Simple.ts index 390ad949c8..d75fefdc67 100644 --- a/ts/WoltLabSuite/Core/Ui/TabMenu/Simple.ts +++ b/ts/WoltLabSuite/Core/Ui/TabMenu/Simple.ts @@ -10,6 +10,7 @@ import * as DomTraverse from "../../Dom/Traverse"; import DomUtil from "../../Dom/Util"; import * as Environment from "../../Environment"; import * as EventHandler from "../../Event/Handler"; +import CloseOverlay from "WoltLabSuite/Core/Ui/CloseOverlay"; class TabMenuSimple { private readonly container: HTMLElement; @@ -319,6 +320,7 @@ class TabMenuSimple { // update history window.history.replaceState(undefined, "", location); } + CloseOverlay.execute(); void import("../TabMenu").then((UiTabMenu) => { UiTabMenu.scrollToTab(tab!); diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/TabMenu/Simple.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/TabMenu/Simple.js index e2d5ffe213..cecf8c5d14 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/TabMenu/Simple.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/TabMenu/Simple.js @@ -5,12 +5,13 @@ * @copyright 2001-2019 WoltLab GmbH * @license GNU Lesser General Public License */ -define(["require", "exports", "tslib", "../../Dom/Traverse", "../../Dom/Util", "../../Environment", "../../Event/Handler"], function (require, exports, tslib_1, DomTraverse, Util_1, Environment, EventHandler) { +define(["require", "exports", "tslib", "../../Dom/Traverse", "../../Dom/Util", "../../Environment", "../../Event/Handler", "WoltLabSuite/Core/Ui/CloseOverlay"], function (require, exports, tslib_1, DomTraverse, Util_1, Environment, EventHandler, CloseOverlay_1) { "use strict"; DomTraverse = tslib_1.__importStar(DomTraverse); Util_1 = tslib_1.__importDefault(Util_1); Environment = tslib_1.__importStar(Environment); EventHandler = tslib_1.__importStar(EventHandler); + CloseOverlay_1 = tslib_1.__importDefault(CloseOverlay_1); class TabMenuSimple { container; containers = new Map(); @@ -266,6 +267,7 @@ define(["require", "exports", "tslib", "../../Dom/Traverse", "../../Dom/Util", " // update history window.history.replaceState(undefined, "", location); } + CloseOverlay_1.default.execute(); void new Promise((resolve_1, reject_1) => { require(["../TabMenu"], resolve_1, reject_1); }).then(tslib_1.__importStar).then((UiTabMenu) => { UiTabMenu.scrollToTab(tab); }); -- 2.20.1