16 lines
700 B
CoffeeScript
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')
|