From: Alexander Ebert Date: Tue, 31 Jan 2012 17:00:07 +0000 (+0100) Subject: TabMenus now properly revert if hash is empty X-Git-Tag: 2.0.0_Beta_1~1364 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3d57a2ddd347b6a4454d49de4e8cbe1d4fdcc7cc;p=GitHub%2FWoltLab%2FWCF.git TabMenus now properly revert if hash is empty Fixes #397 --- 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); } });