   initialize: (options) ->
     _.extend @, options
     @counts.on 'sync', @renderCounts
+    @params.on 'change', @renderActive
 
   renderCounts: =>
     for range, val of @counts.get('price_range')

    for size, val of @counts.get('dimension')
      @$("a[data-size='#{size}'] .filter-dropdown-count").html '(' + val + ')'

  toggleActive: (el) ->
    @$('.is-active').removeClass 'is-active'
    $(el).addClass('is-active')

  events:
    'click .filter-artworks-nav-allworks': 'allWorks'

    'click .filter-dropdown a': 'checkDropdownItem'

  allWorks: ->
    @params.clear()

  filterPrice: (e) ->
    @params.set { price_range: $(e.currentTarget).data 'range' }

  filterMedium: (e) ->
    @params.set { medium: $(e.currentTarget).data 'medium' }

  filterSize: (e) ->
    @params.set { dimension: $(e.currentTarget).data 'size' }

  checkDropdownItem: (e) ->
    $(e.currentTarget)
