From 232f47f55fc2f728cec7f324b3ca31ad0d874394 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Fri, 12 Dec 2014 13:46:10 +0100 Subject: [PATCH] Improved loading behavior for user panel items --- wcfsetup/install/files/js/WCF.User.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) 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; -- 2.20.1