Fixed issues in recent activity context switch
authorMarcel Werk <burntime@woltlab.com>
Tue, 25 Nov 2014 18:40:32 +0000 (19:40 +0100)
committerMarcel Werk <burntime@woltlab.com>
Tue, 25 Nov 2014 18:40:32 +0000 (19:40 +0100)
wcfsetup/install/files/js/WCF.User.js

index c616fe4683062eeb5151a2b84bdaf0d49a3f787b..ba6c52a2c9d8a78e3050defa31a949c9c6db9412 100644 (file)
@@ -1555,18 +1555,22 @@ WCF.User.RecentActivityLoader = Class.extend({
        /**
         * Switches recent activity context.
         */
-       _switchContext: function() {
-               new WCF.Action.Proxy({
-                       autoSend: true,
-                       data: {
-                               actionName: 'switchContext',
-                               className: 'wcf\\data\\user\\activity\\event\\UserActivityEventAction'
-                       },
-                       success: function() {
-                               window.location.hash = '#dashboardBoxRecentActivity';
-                               window.location.reload();
-                       }
-               });
+       _switchContext: function(event) {
+               event.preventDefault();
+               
+               if (!$(event.currentTarget).hasClass('active')) {
+                       new WCF.Action.Proxy({
+                               autoSend: true,
+                               data: {
+                                       actionName: 'switchContext',
+                                       className: 'wcf\\data\\user\\activity\\event\\UserActivityEventAction'
+                               },
+                               success: function() {
+                                       window.location.hash = '#dashboardBoxRecentActivity';
+                                       window.location.reload();
+                               }
+                       });
+               }
        },
        
        /**