Removed not needed render events.

This commit is contained in:
Martin Edenhofer 2015-11-20 15:10:50 +01:00
parent 7315e87b08
commit cbca4fa849
3 changed files with 41 additions and 45 deletions

View file

@ -99,7 +99,9 @@ class App.TaskbarWidget extends App.Controller
active_is_closed = true
# remove task
App.TaskManager.remove( key )
App.TaskManager.remove(key, false)
$(e.target).closest('.task').remove()
# if we do not need to move to an other task
return if !active_is_closed

View file

@ -24,10 +24,10 @@ class App.TaskManager
_instance ?= new _taskManagerSingleton
_instance.update( key, params )
@remove: ( key ) ->
@remove: (key, rerender = true) ->
if _instance == undefined
_instance ?= new _taskManagerSingleton
_instance.remove( key )
_instance.remove(key, rerender)
@notify: ( key ) ->
if _instance == undefined
@ -77,17 +77,13 @@ class _taskManagerSingleton extends Spine.Module
@tasksInitial()
# render on login
App.Event.bind(
'auth:login'
=>
App.Event.bind('auth:login', =>
@tasksInitial()
'task'
)
# render on logout
App.Event.bind(
'auth:logout'
=>
App.Event.bind('auth:logout', =>
@reset()
'task'
)
@ -220,6 +216,7 @@ class _taskManagerSingleton extends Spine.Module
# start worker for task if not exists
@startController(params)
if !params.init
App.Event.trigger 'task:render'
startController: (params) =>
@ -269,7 +266,6 @@ class _taskManagerSingleton extends Spine.Module
# execute controllers show
if controller.show
controller.show(params_app)
App.Event.trigger('ui:rerender:task')
true
@ -306,7 +302,7 @@ class _taskManagerSingleton extends Spine.Module
@taskUpdate(task)
# remove task certain task from tasks
remove: ( key ) =>
remove: (key, rerender) =>
# remember started task
delete @tasksStarted[key]
@ -327,6 +323,7 @@ class _taskManagerSingleton extends Spine.Module
@release(key)
# rerender taskbar
if rerender
App.Event.trigger 'task:render'
# destroy in backend storage

View file

@ -964,8 +964,8 @@ wait untill text in selector disabppears
=begin
tasks_close_all(
:browser => browser1,
:discard_changes => true,
browser: browser1,
discard_changes: true,
)
=end
@ -980,11 +980,8 @@ wait untill text in selector disabppears
begin
if instance.find_elements( { css: '.navigation .tasks .task:first-child' } )[0]
instance.mouse.move_to( instance.find_elements( { css: '.navigation .tasks .task:first-child' } )[0] )
sleep 0.2
click_element = instance.find_elements( { css: '.navigation .tasks .task:first-child .js-close' } )[0]
if click_element
sleep 0.1
click_element.click
# accept task close warning