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
|
# fetch init collection
|
||||||
if param.initFetch is true
|
if param.initFetch is true
|
||||||
@one 'refresh', (collection) =>
|
|
||||||
@initFetchActive = false
|
|
||||||
callback(collection)
|
|
||||||
if !@initFetchActive
|
if !@initFetchActive
|
||||||
|
@one 'refresh', (collection) =>
|
||||||
@initFetchActive = true
|
@initFetchActive = true
|
||||||
|
callback(collection)
|
||||||
@fetch( {}, { clear: true } )
|
@fetch( {}, { clear: true } )
|
||||||
|
else
|
||||||
|
callback( @all() )
|
||||||
|
|
||||||
# return key
|
# return key
|
||||||
key
|
key
|
||||||
|
|
Loading…
Reference in a new issue