From: Alexander Ebert Date: Wed, 27 Aug 2014 17:08:57 +0000 (+0200) Subject: Fixed loading of profile tabs on init X-Git-Tag: 2.1.0_Alpha_1~390 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8bb37fef3ff99f346f51a406b5e33a83afc88aef;p=GitHub%2FWoltLab%2FWCF.git Fixed loading of profile tabs on init --- diff --git a/wcfsetup/install/files/js/WCF.User.js b/wcfsetup/install/files/js/WCF.User.js index 0f45bd1d4f..41357e1771 100644 --- a/wcfsetup/install/files/js/WCF.User.js +++ b/wcfsetup/install/files/js/WCF.User.js @@ -542,7 +542,21 @@ WCF.User.Profile.TabMenu = Class.extend({ success: $.proxy(this._success, this) }); - this._profileContent.bind('wcftabsbeforeactivate', $.proxy(this._loadContent, this)); + this._profileContent.on('wcftabsbeforeactivate', $.proxy(this._loadContent, this)); + + // check which tab is selected + this._profileContent.find('> nav.tabMenu > ul > li').each($.proxy(function(index, listItem) { + var $listItem = $(listItem); + if ($listItem.hasClass('ui-state-active')) { + if (index) { + this._loadContent(null, { + newPanel: $('#' + $listItem.attr('aria-controls')) + }); + } + + return false; + } + }, this)); } }, @@ -2583,7 +2597,6 @@ WCF.User.List = Class.extend({ if (this._cache[this._pageNo]) { var $dialogCreated = false; if (this._dialog === null) { - //this._dialog = $('
').hide().appendTo(document.body); this._dialog = $('
').hide().appendTo(document.body); $dialogCreated = true; } @@ -2599,7 +2612,7 @@ WCF.User.List = Class.extend({ this._dialog.find('.jsPagination').wcfPages({ activePage: this._pageNo, maxPage: this._pageCount - }).bind('wcfpagesswitched', $.proxy(this._showPage, this)); + }).on('wcfpagesswitched', $.proxy(this._showPage, this)); } // show dialog