2014-10-20 16:48:07 -04:00
|
|
|
class @Activities
|
2013-08-26 09:30:03 -04:00
|
|
|
constructor: ->
|
|
|
|
Pager.init 20, true
|
2015-09-03 07:44:54 -04:00
|
|
|
$(".event-filter .btn").bind "click", (event) =>
|
2013-08-26 09:30:03 -04:00
|
|
|
event.preventDefault()
|
|
|
|
@toggleFilter($(event.currentTarget))
|
|
|
|
@reloadActivities()
|
|
|
|
|
|
|
|
reloadActivities: ->
|
|
|
|
$(".content_list").html ''
|
|
|
|
Pager.init 20, true
|
|
|
|
|
|
|
|
|
|
|
|
toggleFilter: (sender) ->
|
2015-09-03 13:27:13 -04:00
|
|
|
sender.toggleClass "active"
|
2013-08-26 09:30:03 -04:00
|
|
|
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(","), { path: '/' }
|