From: Alexander Ebert Date: Sun, 28 Apr 2013 01:54:35 +0000 (+0200) Subject: User Panel dropdowns are now always active X-Git-Tag: 2.0.0_Beta_1~274^2~7^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=531e7fb133fa81df625fa608e973d30b01f8e251;p=GitHub%2FWoltLab%2FWCF.git User Panel dropdowns are now always active Hint: doubleclick bypasses the dropdown --- diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index 9ade67bd23..f7502b077f 100755 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -7617,6 +7617,12 @@ WCF.UserPanel = Class.extend({ */ _link: null, + /** + * language variable name for 'no items' + * @var string + */ + _noItems: '', + /** * reverts to original link if return values are empty * @var boolean @@ -7638,11 +7644,9 @@ WCF.UserPanel = Class.extend({ return; } - if (this._container.data('count')) { - WCF.DOMNodeInsertedHandler.enable(); - this._convert(); - WCF.DOMNodeInsertedHandler.disable(); - } + WCF.DOMNodeInsertedHandler.enable(); + this._convert(); + WCF.DOMNodeInsertedHandler.disable(); }, /** @@ -7657,6 +7661,11 @@ WCF.UserPanel = Class.extend({ $('
  • ' + WCF.Language.get('wcf.global.loading') + '
  • ').appendTo($dropdownMenu); this._addDefaultItems($dropdownMenu); + + this._container.dblclick($.proxy(function() { + window.location = this._link.attr('href'); + return false; + }, this)); }, /** @@ -7709,16 +7718,15 @@ WCF.UserPanel = Class.extend({ * @param jQuery jqXHR */ _success: function(data, textStatus, jqXHR) { + var $dropdownMenu = this._container.children('.dropdownMenu'); + $dropdownMenu.children('.jsDropdownPlaceholder').remove(); + if (data.returnValues && data.returnValues.template) { - var $dropdownMenu = this._container.children('.dropdownMenu'); - $dropdownMenu.children('.jsDropdownPlaceholder').remove(); $('' + data.returnValues.template).prependTo($dropdownMenu); - this._after($dropdownMenu); } else { - this._container.removeClass('dropdown').empty(); - this._link.appendTo(this._container); + $('
  • ' + WCF.Language.get(this._noItems) + '
  • ').prependTo($dropdownMenu); // remove badge this._container.find('.badge').remove();