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
|
||||
|
||||
# execute callback if record got loaded
|
||||
col = @
|
||||
App[ @className ].one 'refresh', (record) ->
|
||||
delay = =>
|
||||
data = App[ @className ].find( id )
|
||||
if callback
|
||||
App[ @className ].one 'refresh', (records) ->
|
||||
for record in records
|
||||
if record.id.toString() is id.toString()
|
||||
data = App[ @className ].find( record.id )
|
||||
callback( data )
|
||||
window.setTimeout(delay, 200)
|
||||
|
||||
# fetch object
|
||||
console.log 'debug', 'loading..' + @className + '..', id
|
||||
|
|
Loading…
Reference in a new issue