Fix toggle button on hooks list in profile
This commit is contained in:
parent
71f4885472
commit
1e6672eb9f
|
@ -5,3 +5,6 @@ Travis.AccountIndexController = Em.Controller.extend
|
|||
|
||||
sync: ->
|
||||
@get('user').sync()
|
||||
|
||||
toggle: (hook) ->
|
||||
hook.toggle()
|
||||
|
|
|
@ -23,6 +23,9 @@ Travis.ProfileController = Travis.Controller.extend
|
|||
sync: ->
|
||||
@get('user').sync()
|
||||
|
||||
toggle: (hook) ->
|
||||
hook.toggle()
|
||||
|
||||
activate: (action, params) ->
|
||||
@setParams(params || @get('params'))
|
||||
this["view#{$.camelize(action)}"]()
|
||||
|
|
|
@ -102,6 +102,18 @@ Travis.RestAdapter = DS.RESTAdapter.extend
|
|||
merge: (store, record, serialized) ->
|
||||
@get('serializer').merge(record, serialized)
|
||||
|
||||
didSaveRecord: (store, type, record, payload) ->
|
||||
# API sometimes return { result: true } response
|
||||
# which does not play nice with ember-data. For now
|
||||
# let's just change payload to have serialized record
|
||||
# included, but ideally it should be fixed in the API
|
||||
# to be consistent across all the endpoints.
|
||||
if payload?.result == true
|
||||
payload = {}
|
||||
payload[type.singularName()] = record.serialize()
|
||||
|
||||
@_super(store, type, record, payload)
|
||||
|
||||
Travis.RestAdapter.map 'Travis.Commit', {}
|
||||
|
||||
Travis.RestAdapter.map 'Travis.Build', {
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
<div class="controls">
|
||||
<a {{bindAttr href="hook.urlGithubAdmin"}} class="github-admin tool-tip" title="Github service hooks admin page"></a>
|
||||
<a {{action toggle target="hook"}} class="switch">
|
||||
<a {{action toggle hook}} class="switch">
|
||||
{{#if hook.active}}
|
||||
ON
|
||||
{{else}}
|
||||
|
|
Loading…
Reference in New Issue
Block a user