summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/activities.js
diff options
context:
space:
mode:
authorClement Ho <ClemMakesApps@gmail.com>2016-08-29 12:09:33 -0500
committerClement Ho <ClemMakesApps@gmail.com>2016-10-05 15:38:18 -0500
commitb4d614bdbcb50f506c56eaa180d7b3f3055884a8 (patch)
tree632466173ac4f48c8d366611ccc46d17a24cc59f /app/assets/javascripts/activities.js
parent2d9c8f44659ffd09dd073358a7862f033ca468d8 (diff)
downloadgitlab-ce-b4d614bdbcb50f506c56eaa180d7b3f3055884a8.tar.gz
Fix inconsistent highlighting of already selected activity nav-links
Diffstat (limited to 'app/assets/javascripts/activities.js')
-rw-r--r--app/assets/javascripts/activities.js12
1 files changed, 5 insertions, 7 deletions
diff --git a/app/assets/javascripts/activities.js b/app/assets/javascripts/activities.js
index d5e11e22be5..f4f8cf04184 100644
--- a/app/assets/javascripts/activities.js
+++ b/app/assets/javascripts/activities.js
@@ -21,16 +21,14 @@
};
Activities.prototype.toggleFilter = function(sender) {
- var event_filters, filter;
+ var filter = sender.attr("id").split("_")[0];
+
$('.event-filter .active').removeClass("active");
- event_filters = $.cookie("event_filter");
- filter = sender.attr("id").split("_")[0];
- $.cookie("event_filter", (event_filters !== filter ? filter : ""), {
+ $.cookie("event_filter", filter, {
path: gon.relative_url_root || '/'
});
- if (event_filters !== filter) {
- return sender.closest('li').toggleClass("active");
- }
+
+ sender.closest('li').toggleClass("active");
};
return Activities;