Fixed clearDelay().
This commit is contained in:
parent
7a2fe91c27
commit
3dacc8f683
1 changed files with 6 additions and 6 deletions
|
@ -182,22 +182,22 @@ class App.Controller extends Spine.Controller
|
||||||
# check global var
|
# check global var
|
||||||
if !@_delayID
|
if !@_delayID
|
||||||
@_delayID = {}
|
@_delayID = {}
|
||||||
|
|
||||||
clearTimeout( @_delayID[delay_id] ) if @_delayID[delay_id]
|
clearTimeout( @_delayID[delay_id] ) if @_delayID[delay_id]
|
||||||
|
|
||||||
delay: (callback, timeout, delay_id) =>
|
delay: (callback, timeout, delay_id) =>
|
||||||
|
|
||||||
# check global var
|
|
||||||
if !@_delayID
|
|
||||||
@_delayID = {}
|
|
||||||
|
|
||||||
# clear auto save
|
# clear auto save
|
||||||
@clearDelay( @_delayID[delay_id] )
|
@clearDelay( delay_id )
|
||||||
|
|
||||||
# request new data
|
# request new data
|
||||||
call = =>
|
call = =>
|
||||||
callback()
|
callback()
|
||||||
if delay_id
|
if delay_id
|
||||||
|
|
||||||
|
# check global var
|
||||||
|
if !@_delayID
|
||||||
|
@_delayID = {}
|
||||||
|
|
||||||
@_delayID[delay_id] = setTimeout( call, timeout )
|
@_delayID[delay_id] = setTimeout( call, timeout )
|
||||||
else
|
else
|
||||||
setTimeout( call, timeout )
|
setTimeout( call, timeout )
|
||||||
|
|
Loading…
Reference in a new issue