From dc756c0bd8172687bfc595a40fd807df83100dde Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sat, 10 Dec 2016 23:28:20 +0100 Subject: [PATCH] Added event before tab change --- .../files/js/WoltLabSuite/Core/Ui/TabMenu/Simple.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 ae9d26c2cf..5fc784fd23 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/TabMenu/Simple.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/TabMenu/Simple.js @@ -215,11 +215,19 @@ define(['Dictionary', 'EventHandler', 'Dom/Traverse', 'Dom/Util'], function(Dict var oldTab = this.getActiveTab(); var oldContent = null; if (oldTab) { - if (elData(oldTab, 'name') === name) { + var oldTabName = elData(oldTab, 'name'); + if (oldTabName === name) { // same tab return; } + if (!disableEvent) { + EventHandler.fire('com.woltlab.wcf.simpleTabMenu_' + this._container.id, 'beforeSelect', { + tab: oldTab, + tabName: oldTabName + }); + } + oldTab.classList.remove('active'); oldContent = this._containers.get(elData(oldTab, 'name')); oldContent.classList.remove('active'); -- 2.20.1