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" activeBinding: "hook.active"
click: -> click: ->
@sendAction('onToggle')
hook = @get('hook') hook = @get('hook')
hook.toggle().then( (->), => hook.toggle().then( (->), =>
@toggleProperty('hook.active') @toggleProperty('hook.active')

View File

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

View File

@ -1,5 +1,5 @@
<div class="profile-hooks columns"> <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> --}} {{!-- <button class="switch is-on"></button> --}}
{{#if hook.isSaving}} {{#if hook.isSaving}}
<span class="sync-spinner sync-spinner--grey"><i></i><i></i><i></i></span> <span class="sync-spinner sync-spinner--grey"><i></i><i></i><i></i></span>