Improved initFetch behaviour.

This commit is contained in:
Martin Edenhofer 2014-09-22 19:36:18 +02:00
parent 12fc2adc3e
commit 24d9c523c4

View file

@ -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