Improved initFetch behaviour.
This commit is contained in:
parent
12fc2adc3e
commit
24d9c523c4
1 changed files with 5 additions and 4 deletions
|
@ -327,12 +327,13 @@ class App.Model extends Spine.Model
|
|||
|
||||
# fetch init collection
|
||||
if param.initFetch is true
|
||||
@one 'refresh', (collection) =>
|
||||
@initFetchActive = false
|
||||
callback(collection)
|
||||
if !@initFetchActive
|
||||
@initFetchActive = true
|
||||
@one 'refresh', (collection) =>
|
||||
@initFetchActive = true
|
||||
callback(collection)
|
||||
@fetch( {}, { clear: true } )
|
||||
else
|
||||
callback( @all() )
|
||||
|
||||
# return key
|
||||
key
|
||||
|
|
Loading…
Reference in a new issue