From: Alexander Ebert Date: Sun, 28 Apr 2013 12:54:59 +0000 (+0200) Subject: Updating badge on user panel loaded X-Git-Tag: 2.0.0_Beta_1~274^2~5 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5d10caf81a1abf0a1f0f156ea13f8adb8151928b;p=GitHub%2FWoltLab%2FWCF.git Updating badge on user panel loaded --- diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index f7502b077f..37b37f30e9 100755 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -7723,6 +7723,14 @@ WCF.UserPanel = Class.extend({ if (data.returnValues && data.returnValues.template) { $('' + data.returnValues.template).prependTo($dropdownMenu); + + // update badge + var $badge = this._container.find('.badge'); + if (!$badge.length) { + $badge = $('').appendTo(this._container.children('.dropdownToggle')); + } + $badge.html(data.returnValues.totalCount); + this._after($dropdownMenu); } else {