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
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()
index = event_filters.indexOf(filter)
if index is -1
event_filters.push filter
else
event_filters.splice index, 1
$.cookie "event_filter", (if event_filters isnt filter then filter else ""), { path: '/' }
$.cookie "event_filter", event_filters.join(","), { path: '/' }
if event_filters isnt filter
sender.closest('li').toggleClass "active"
......@@ -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
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