From: Alexander Ebert Date: Fri, 12 Dec 2014 12:46:10 +0000 (+0100) Subject: Improved loading behavior for user panel items X-Git-Tag: 2.1.0_Beta_1~64 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=232f47f55fc2f728cec7f324b3ca31ad0d874394;p=GitHub%2FWoltLab%2FWCF.git Improved loading behavior for user panel items --- diff --git a/wcfsetup/install/files/js/WCF.User.js b/wcfsetup/install/files/js/WCF.User.js index f1ca461042..f1e0b22631 100644 --- a/wcfsetup/install/files/js/WCF.User.js +++ b/wcfsetup/install/files/js/WCF.User.js @@ -202,8 +202,21 @@ WCF.User.Panel.Abstract = Class.extend({ this._dropdown = this._initDropdown(); } - if (this._dropdown.toggle() && this._loadData) { - this._load(); + if (this._dropdown.toggle()) { + if (!this._loadData) { + // check if there are outstanding items but there are no outstanding ones in the current list + if (this._badge !== null) { + var $count = parseInt(this._badge.text()) || 0; + if ($count && !this._dropdown.getItemList().children('.interactiveDropdownItemOutstanding').length) { + this._loadData = true; + } + } + } + + if (this._loadData) { + this._loadData = false; + this._load(); + } } return false;