diff --git a/app/components/hook-switch.coffee b/app/components/hook-switch.coffee new file mode 100644 index 00000000..196e35ec --- /dev/null +++ b/app/components/hook-switch.coffee @@ -0,0 +1,17 @@ +`import Ember from 'ember'` + +HookSwitchComponent = Ember.Component.extend + tagName: 'a' + classNames: ['travis-switch', 'switch'] + classNameBindings: ['active'] + activeBinding: "hook.active" + + click: -> + hook = @get('hook') + hook.toggle().then( (->), => + @toggleProperty('hook.active') + @sendAction('onToggleError', hook) + ) + + +`export default HookSwitchComponent` diff --git a/app/components/hooks-list-item.coffee b/app/components/hooks-list-item.coffee new file mode 100644 index 00000000..7cf32639 --- /dev/null +++ b/app/components/hooks-list-item.coffee @@ -0,0 +1,11 @@ +`import Ember from 'ember'` + +HooksListItemComponent = Ember.Component.extend + tagName: 'li' + classNames: ['row'] + classNameBindings: ['hook.active:active'] + actions: + handleToggleError: -> + @set("errorMessage", "There was an error") + +`export default HooksListItemComponent` diff --git a/app/templates/account.hbs b/app/templates/account.hbs index a7ef4634..76a79f94 100644 --- a/app/templates/account.hbs +++ b/app/templates/account.hbs @@ -73,20 +73,7 @@