From 3d57a2ddd347b6a4454d49de4e8cbe1d4fdcc7cc Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Tue, 31 Jan 2012 18:00:07 +0100 Subject: [PATCH] TabMenus now properly revert if hash is empty Fixes #397 --- wcfsetup/install/files/js/WCF.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index bc3364feda..8149c828aa 100644 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -2223,6 +2223,12 @@ WCF.TabMenu = { } } } + else { + // revert to default values + for (var $containerID in this._containers) { + this._containers[$containerID].wcfTabs('revertToDefault'); + } + } } }; @@ -4388,6 +4394,16 @@ $.widget('ui.wcfTabs', $.ui.tabs, { }); return $matches; + }, + + /** + * Shows default tab. + */ + revertToDefault: function() { + var $active = this.element.data('active'); + if (!$active || $active === '') $active = 0; + + this.select($active); } }); -- 2.20.1