From: Alexander Ebert Date: Thu, 22 Dec 2016 15:54:38 +0000 (+0100) Subject: Fixed context switch for recent activities X-Git-Tag: 3.0.0_RC_3~71 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0157a422179c2f34dee37936447b716b75b73e9c;p=GitHub%2FWoltLab%2FWCF.git Fixed context switch for recent activities --- diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/User/Activity/Recent.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/User/Activity/Recent.js index 2bda92c98c..6a2684c0a6 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/User/Activity/Recent.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/User/Activity/Recent.js @@ -21,10 +21,15 @@ define(['Ajax', 'Language', 'Dom/Util'], function(Ajax, Language, DomUtil) { this._list.appendChild(showMoreItem); this._showMoreItem = showMoreItem; - var button = elBySel('.jsRecentActivitySwitchContext button:not(.active)', container); - if (button !== null) { - button.addEventListener(WCF_CLICK_EVENT, this._switchContext.bind(this)); - } + elBySelAll('.jsRecentActivitySwitchContext .button', container, (function (button) { + button.addEventListener(WCF_CLICK_EVENT, (function (event) { + event.preventDefault(); + + if (!button.classList.contains('active')) { + this._switchContext(); + } + }).bind(this)); + }).bind(this)); }, _showMore: function (event) { @@ -44,9 +49,7 @@ define(['Ajax', 'Language', 'Dom/Util'], function(Ajax, Language, DomUtil) { }); }, - _switchContext: function(event) { - event.preventDefault(); - + _switchContext: function() { Ajax.api( this, {