diff options
author | Jacob Schatz <jschatz1@gmail.com> | 2016-02-24 11:49:47 +0000 |
---|---|---|
committer | Jacob Schatz <jschatz1@gmail.com> | 2016-02-24 11:49:47 +0000 |
commit | 89fc80beb5516f1c482c61520f328d867e7a07cf (patch) | |
tree | 32a6e8cc067c392fff4d7f66e4b662bcffeedd8d | |
parent | 043208f164c8aca0ff0edeb238e554d16c667eea (diff) | |
parent | 74d87db977384f73e496a5851e7b8c2fd2333f23 (diff) | |
download | gitlab-ce-89fc80beb5516f1c482c61520f328d867e7a07cf.tar.gz |
Merge branch 'activity-tabs-single-select' into 'master'
Treats activity tabs as single select
Fixes #8092
![activity-tabs](/uploads/1fb4d9233492252cfd93c74579e97514/activity-tabs.gif)
See merge request !2940
-rw-r--r-- | app/assets/javascripts/activities.js.coffee | 18 | ||||
-rw-r--r-- | features/dashboard/event_filters.feature | 12 |
2 files changed, 14 insertions, 16 deletions
diff --git a/app/assets/javascripts/activities.js.coffee b/app/assets/javascripts/activities.js.coffee index 3b6b453ac51..5092e824e65 100644 --- a/app/assets/javascripts/activities.js.coffee +++ b/app/assets/javascripts/activities.js.coffee @@ -1,7 +1,7 @@ class @Activities constructor: -> Pager.init 20, true - $(".event-filter a").bind "click", (event) => + $(".event-filter-link").on "click", (event) => event.preventDefault() @toggleFilter($(event.currentTarget)) @reloadActivities() @@ -12,18 +12,10 @@ class @Activities toggleFilter: (sender) -> - sender.closest('li').toggleClass "active" + $('.event-filter .active').removeClass "active" event_filters = $.cookie("event_filter") filter = sender.attr("id").split("_")[0] - if event_filters - event_filters = event_filters.split(",") - else - event_filters = new Array() + $.cookie "event_filter", (if event_filters isnt filter then filter else ""), { path: '/' } - index = event_filters.indexOf(filter) - if index is -1 - event_filters.push filter - else - event_filters.splice index, 1 - - $.cookie "event_filter", event_filters.join(","), { path: '/' } + if event_filters isnt filter + sender.closest('li').toggleClass "active" diff --git a/features/dashboard/event_filters.feature b/features/dashboard/event_filters.feature index 96399ea21a6..8c3ff64164f 100644 --- a/features/dashboard/event_filters.feature +++ b/features/dashboard/event_filters.feature @@ -43,10 +43,16 @@ Feature: Event Filters And I should not see new member event When I click "team" event filter And I visit dashboard activity page - Then I should see push event + Then I should not see push event And I should see new member event And I should not see merge request event When I click "push" event filter - Then I should not see push event - And I should see new member event + And I visit dashboard activity page + Then I should see push event + And I should not see new member event And I should not see merge request event + When I click "merge" event filter + And I visit dashboard activity page + Then I should see merge request event + And I should not see push event + And I should not see new member event |