travis-web/app/components/broadcast-tower.coffee
2015-10-23 12:17:26 +02:00

25 lines
526 B
CoffeeScript

`import Ember from 'ember'`
BroadcastTowerComponent = Ember.Component.extend
classNames: ['broadcast']
isOpen: false
timeoutId: ''
actions:
toggleBroadcasts:() ->
@toggleProperty('isOpen')
@sendAction('toggleBroadcasts')
if @get('isOpen') == true
@set('timeoutId', setTimeout =>
@toggleProperty('isOpen')
@sendAction('toggleBroadcasts')
, 10000
)
else
clearTimeout(@get('timeoutId'))
`export default BroadcastTowerComponent`