travis-web/app/components/hook-switch.coffee
2015-07-06 20:25:50 +02:00

19 lines
404 B
CoffeeScript

`import Ember from 'ember'`
HookSwitchComponent = Ember.Component.extend
tagName: 'a'
classNames: ['switch--icon']
classNameBindings: ['active']
activeBinding: "hook.active"
click: ->
@sendAction('onToggle')
hook = @get('hook')
hook.toggle().then( (->), =>
@toggleProperty('hook.active')
@sendAction('onToggleError', hook)
)
`export default HookSwitchComponent`