Remove error message when toggling hook

This commit is contained in:
Piotr Sarnacki 2015-04-23 10:52:53 +02:00
parent cc1ae3c2e7
commit 268bc6096a
3 changed files with 5 additions and 1 deletions

View File

@ -7,6 +7,7 @@ HookSwitchComponent = Ember.Component.extend
activeBinding: "hook.active"
click: ->
@sendAction('onToggle')
hook = @get('hook')
hook.toggle().then( (->), =>
@toggleProperty('hook.active')

View File

@ -13,6 +13,9 @@ HooksListItemComponent = Ember.Component.extend
@set("showError", true)
close: ->
@send('resetErrors')
resetErrors: ->
@set("showError", false)
`export default HooksListItemComponent`

View File

@ -1,5 +1,5 @@
<div class="profile-hooks columns">
{{hook-switch hook=hook onToggleError="handleToggleError"}}
{{hook-switch hook=hook onToggleError="handleToggleError" onToggle="resetErrors"}}
{{!-- <button class="switch is-on"></button> --}}
{{#if hook.isSaving}}
<span class="sync-spinner sync-spinner--grey"><i></i><i></i><i></i></span>