gitlabhq/app/assets/javascripts/dashboard.js.coffee

28 lines
699 B
CoffeeScript
Raw Normal View History

window.dashboardPage = ->
2013-01-09 20:28:31 +01:00
Pager.init 20, true
$(".event_filter_link").bind "click", (event) ->
event.preventDefault()
2013-01-09 20:28:31 +01:00
toggleFilter $(this)
reloadActivities()
reloadActivities = ->
$(".content_list").html ''
Pager.init 20, true
toggleFilter = (sender) ->
sender.parent().toggleClass "inactive"
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", event_filters.join(",")