Fixed Model.retrieve()
This commit is contained in:
parent
25f576ca35
commit
a7a48cfa96
1 changed files with 4 additions and 6 deletions
|
@ -114,13 +114,11 @@ class App.Model extends Spine.Model
|
||||||
if callback
|
if callback
|
||||||
|
|
||||||
# execute callback if record got loaded
|
# execute callback if record got loaded
|
||||||
col = @
|
App[ @className ].one 'refresh', (records) ->
|
||||||
App[ @className ].one 'refresh', (record) ->
|
for record in records
|
||||||
delay = =>
|
if record.id.toString() is id.toString()
|
||||||
data = App[ @className ].find( id )
|
data = App[ @className ].find( record.id )
|
||||||
if callback
|
|
||||||
callback( data )
|
callback( data )
|
||||||
window.setTimeout(delay, 200)
|
|
||||||
|
|
||||||
# fetch object
|
# fetch object
|
||||||
console.log 'debug', 'loading..' + @className + '..', id
|
console.log 'debug', 'loading..' + @className + '..', id
|
||||||
|
|
Loading…
Reference in a new issue