Only populate list from timeout when still on DOM

This commit is contained in:
Kevin Sawicki
2013-04-02 13:14:56 -07:00
parent 0e1adddd2f
commit f3e1a72882

View File

@@ -45,7 +45,9 @@ class SelectList extends View
schedulePopulateList: ->
clearTimeout(@scheduleTimeout)
@scheduleTimeout = setTimeout((=> @populateList()), @inputThrottle)
populateCallback = =>
@populateList() if @isOnDom()
@scheduleTimeout = setTimeout(populateCallback, @inputThrottle)
setArray: (@array) ->
@populateList()