Improved init task rendering, reduced dom operations.

This commit is contained in:
Martin Edenhofer 2015-12-02 08:45:58 +01:00
parent 6b3d1612a8
commit 1439588581
2 changed files with 11 additions and 2 deletions

View file

@ -542,9 +542,11 @@ class App.Controller extends Spine.Controller
@html App.view('generic/error/unauthorized')(data) @html App.view('generic/error/unauthorized')(data)
metaTaskUpdate: -> metaTaskUpdate: ->
delay = App.TaskManager.renderDelay()
return if !delay
App.Delay.set( App.Delay.set(
-> App.Event.trigger 'task:render' -> App.Event.trigger 'task:render'
App.TaskManager.renderDelay() delay
'meta-task-update' 'meta-task-update'
) )

View file

@ -496,10 +496,17 @@ class _taskManagerSingleton extends App.Controller
'task' 'task'
) )
# set new renderDelayTime # handle init task rendering at loading time, prevent multible, not needed dom operations
@initTaskRenderInterval = App.Interval.set(
->
App.Event.trigger('task:render')
1200
)
App.Delay.set( App.Delay.set(
=> =>
App.Interval.clear(@initTaskRenderInterval)
@renderDelayTime = 20 @renderDelayTime = 20
App.Event.trigger('task:render')
task_count * 450 task_count * 450
) )