unepwcmc/SAPI

View on GitHub
app/assets/javascripts/species/helpers/search_taxonomy_toggle_button.js.coffee

Summary

Maintainability
Test Coverage
Species.SearchTaxonomyToggleButton = Ember.View.extend
  tagName: 'a'
  href: '#'
  classNameBindings: ['active:active:']

  active: ( ->
    @get("option") == @get("value")
  ).property('value')

  click: (e) ->
    option = @.get("option")
    @set("value", option)
    @get('controller').send('redirectToOpenSearchPage', {"taxonomy": option})