2014-10-20 16:48:07 -04:00
|
|
|
class @Activities
|
2013-08-26 09:30:03 -04:00
|
|
|
constructor: ->
|
|
|
|
Pager.init 20, true
|
2016-02-23 12:28:12 -05:00
|
|
|
$(".event-filter-link").on "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) ->
|
2016-02-23 08:29:36 -05:00
|
|
|
$('.event-filter .active').removeClass "active"
|
2013-08-26 09:30:03 -04:00
|
|
|
event_filters = $.cookie("event_filter")
|
|
|
|
filter = sender.attr("id").split("_")[0]
|
2016-02-23 08:29:36 -05:00
|
|
|
$.cookie "event_filter", (if event_filters isnt filter then filter else ""), { path: '/' }
|
2013-08-26 09:30:03 -04:00
|
|
|
|
2016-02-23 08:29:36 -05:00
|
|
|
if event_filters isnt filter
|
|
|
|
sender.closest('li').toggleClass "active"
|