From 5d10caf81a1abf0a1f0f156ea13f8adb8151928b Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sun, 28 Apr 2013 14:54:59 +0200 Subject: [PATCH] Updating badge on user panel loaded --- wcfsetup/install/files/js/WCF.js | 8 ++++++++ 1 file changed, 8 insertions(+) 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 { -- 2.20.1