Revert "Revert "Use switches on settings pane""
This reverts commit e5ae06afeb
.
This commit is contained in:
parent
e5ae06afeb
commit
0679fc260c
|
@ -1,9 +1,19 @@
|
||||||
Travis.TravisSwitchComponent = Ember.Component.extend
|
Travis.TravisSwitchComponent = Ember.Component.extend
|
||||||
tagName: 'a'
|
tagName: 'a'
|
||||||
classNames: ['travis-switch']
|
classNames: ['travis-switch']
|
||||||
classNameBindings: ['active']
|
classNameBindings: ['_active:active']
|
||||||
|
|
||||||
activeBinding: 'target.active'
|
# TODO: how to handle overriding properties to
|
||||||
|
# avoid naming it _action?
|
||||||
|
_active: (->
|
||||||
|
@get('target.active') || @get('active')
|
||||||
|
).property('target.active', 'active')
|
||||||
|
|
||||||
click: ->
|
click: ->
|
||||||
@sendAction('action', @get('target'))
|
if target = @get('target')
|
||||||
|
@set('target.active', !@get('target.active'))
|
||||||
|
else
|
||||||
|
@set('active', !@get('active'))
|
||||||
|
# allow for bindings to propagate
|
||||||
|
Ember.run.next this, ->
|
||||||
|
@sendAction('action', target)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{{#if active}}
|
{{#if _active}}
|
||||||
ON
|
ON
|
||||||
{{else}}
|
{{else}}
|
||||||
OFF
|
OFF
|
||||||
|
|
Loading…
Reference in New Issue
Block a user