Commit 89fc80be authored by Jacob Schatz's avatar Jacob Schatz

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
parents 043208f1 74d87db9
class @Activities class @Activities
constructor: -> constructor: ->
Pager.init 20, true Pager.init 20, true
$(".event-filter a").bind "click", (event) => $(".event-filter-link").on "click", (event) =>
event.preventDefault() event.preventDefault()
@toggleFilter($(event.currentTarget)) @toggleFilter($(event.currentTarget))
@reloadActivities() @reloadActivities()
...@@ -12,18 +12,10 @@ class @Activities ...@@ -12,18 +12,10 @@ class @Activities
toggleFilter: (sender) -> toggleFilter: (sender) ->
sender.closest('li').toggleClass "active" $('.event-filter .active').removeClass "active"
event_filters = $.cookie("event_filter") event_filters = $.cookie("event_filter")
filter = sender.attr("id").split("_")[0] filter = sender.attr("id").split("_")[0]
if event_filters $.cookie "event_filter", (if event_filters isnt filter then filter else ""), { path: '/' }
event_filters = event_filters.split(",")
else
event_filters = new Array()
index = event_filters.indexOf(filter) if event_filters isnt filter
if index is -1 sender.closest('li').toggleClass "active"
event_filters.push filter
else
event_filters.splice index, 1
$.cookie "event_filter", event_filters.join(","), { path: '/' }
...@@ -43,10 +43,16 @@ Feature: Event Filters ...@@ -43,10 +43,16 @@ Feature: Event Filters
And I should not see new member event And I should not see new member event
When I click "team" event filter When I click "team" event filter
And I visit dashboard activity page 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 see new member event
And I should not see merge request event And I should not see merge request event
When I click "push" event filter When I click "push" event filter
Then I should not see push event And I visit dashboard activity page
And I should see new member event Then I should see push event
And I should not see new member event
And I should not see merge request 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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment