From 0f279d43c579cc0285adcb7209946abb9dfefeb6 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Fri, 12 Dec 2014 18:53:28 +0100 Subject: [PATCH] Double-clicking a user panel item forwards to 'show all' URL --- wcfsetup/install/files/js/WCF.User.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/wcfsetup/install/files/js/WCF.User.js b/wcfsetup/install/files/js/WCF.User.js index f1e0b22631..ecb6b99db7 100644 --- a/wcfsetup/install/files/js/WCF.User.js +++ b/wcfsetup/install/files/js/WCF.User.js @@ -182,6 +182,9 @@ WCF.User.Panel.Abstract = Class.extend({ }); this._triggerElement.click($.proxy(this.toggle, this)); + if (this._options.showAllLink) { + this._triggerElement.dblclick($.proxy(this._dblClick, this)); + } var $badge = this._triggerElement.find('span.badge'); if ($badge.length) { @@ -222,6 +225,20 @@ WCF.User.Panel.Abstract = Class.extend({ return false; }, + /** + * Forward to original URL by double clicking the trigger element. + * + * @param object event + * @return boolean + */ + _dblClick: function(event) { + event.preventDefault(); + + window.location = this._options.showAllLink; + + return false; + }, + /** * Initializes the dropdown on first usage. * -- 2.20.1