Files
mozo-backend/app/assets/javascripts/supplier/app/components/sections_header_component.js.coffee
T
2015-02-20 19:21:25 +01:00

16 lines
700 B
CoffeeScript

App.SectionsHeaderComponent = Ember.Component.extend
sections: (-> @get('targetObject.store').all('section') ).property()
actions:
setSection: (section)->
if section and section is @get('section')
# click on already active section
#return @transitionTo('section', section.id)
return App.Router.router.transitionTo('section', section)
@$('dd').removeClass('active')
@$("[data-section=#{if section then section.id else 'all'}]").addClass('active')
@set('section', section)
didInsertElement: ->
@$('dd').removeClass('active')
section = @get('section')
@$("[data-section=#{if section then section.id else 'all'}]").addClass('active')