From 531e7fb133fa81df625fa608e973d30b01f8e251 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sun, 28 Apr 2013 03:54:35 +0200 Subject: [PATCH] User Panel dropdowns are now always active Hint: doubleclick bypasses the dropdown --- wcfsetup/install/files/js/WCF.js | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) 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(); -- 2.20.1