Double-clicking a user panel item forwards to 'show all' URL
authorAlexander Ebert <ebert@woltlab.com>
Fri, 12 Dec 2014 17:53:28 +0000 (18:53 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Fri, 12 Dec 2014 17:53:28 +0000 (18:53 +0100)
wcfsetup/install/files/js/WCF.User.js

index f1e0b226313448ec24d8ada73ecb0452ccf0bfe6..ecb6b99db7d2f0e53674e86b90ed410731758e4d 100644 (file)
@@ -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.
         *