Removed not needed render events.
This commit is contained in:
parent
7315e87b08
commit
cbca4fa849
3 changed files with 41 additions and 45 deletions
|
@ -99,7 +99,9 @@ class App.TaskbarWidget extends App.Controller
|
||||||
active_is_closed = true
|
active_is_closed = true
|
||||||
|
|
||||||
# remove task
|
# 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
|
# if we do not need to move to an other task
|
||||||
return if !active_is_closed
|
return if !active_is_closed
|
||||||
|
|
|
@ -24,10 +24,10 @@ class App.TaskManager
|
||||||
_instance ?= new _taskManagerSingleton
|
_instance ?= new _taskManagerSingleton
|
||||||
_instance.update( key, params )
|
_instance.update( key, params )
|
||||||
|
|
||||||
@remove: ( key ) ->
|
@remove: (key, rerender = true) ->
|
||||||
if _instance == undefined
|
if _instance == undefined
|
||||||
_instance ?= new _taskManagerSingleton
|
_instance ?= new _taskManagerSingleton
|
||||||
_instance.remove( key )
|
_instance.remove(key, rerender)
|
||||||
|
|
||||||
@notify: ( key ) ->
|
@notify: ( key ) ->
|
||||||
if _instance == undefined
|
if _instance == undefined
|
||||||
|
@ -77,17 +77,13 @@ class _taskManagerSingleton extends Spine.Module
|
||||||
@tasksInitial()
|
@tasksInitial()
|
||||||
|
|
||||||
# render on login
|
# render on login
|
||||||
App.Event.bind(
|
App.Event.bind('auth:login', =>
|
||||||
'auth:login'
|
|
||||||
=>
|
|
||||||
@tasksInitial()
|
@tasksInitial()
|
||||||
'task'
|
'task'
|
||||||
)
|
)
|
||||||
|
|
||||||
# render on logout
|
# render on logout
|
||||||
App.Event.bind(
|
App.Event.bind('auth:logout', =>
|
||||||
'auth:logout'
|
|
||||||
=>
|
|
||||||
@reset()
|
@reset()
|
||||||
'task'
|
'task'
|
||||||
)
|
)
|
||||||
|
@ -220,6 +216,7 @@ class _taskManagerSingleton extends Spine.Module
|
||||||
# start worker for task if not exists
|
# start worker for task if not exists
|
||||||
@startController(params)
|
@startController(params)
|
||||||
|
|
||||||
|
if !params.init
|
||||||
App.Event.trigger 'task:render'
|
App.Event.trigger 'task:render'
|
||||||
|
|
||||||
startController: (params) =>
|
startController: (params) =>
|
||||||
|
@ -269,7 +266,6 @@ class _taskManagerSingleton extends Spine.Module
|
||||||
# execute controllers show
|
# execute controllers show
|
||||||
if controller.show
|
if controller.show
|
||||||
controller.show(params_app)
|
controller.show(params_app)
|
||||||
App.Event.trigger('ui:rerender:task')
|
|
||||||
|
|
||||||
true
|
true
|
||||||
|
|
||||||
|
@ -306,7 +302,7 @@ class _taskManagerSingleton extends Spine.Module
|
||||||
@taskUpdate(task)
|
@taskUpdate(task)
|
||||||
|
|
||||||
# remove task certain task from tasks
|
# remove task certain task from tasks
|
||||||
remove: ( key ) =>
|
remove: (key, rerender) =>
|
||||||
|
|
||||||
# remember started task
|
# remember started task
|
||||||
delete @tasksStarted[key]
|
delete @tasksStarted[key]
|
||||||
|
@ -327,6 +323,7 @@ class _taskManagerSingleton extends Spine.Module
|
||||||
@release(key)
|
@release(key)
|
||||||
|
|
||||||
# rerender taskbar
|
# rerender taskbar
|
||||||
|
if rerender
|
||||||
App.Event.trigger 'task:render'
|
App.Event.trigger 'task:render'
|
||||||
|
|
||||||
# destroy in backend storage
|
# destroy in backend storage
|
||||||
|
|
|
@ -964,8 +964,8 @@ wait untill text in selector disabppears
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
tasks_close_all(
|
tasks_close_all(
|
||||||
:browser => browser1,
|
browser: browser1,
|
||||||
:discard_changes => true,
|
discard_changes: true,
|
||||||
)
|
)
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
@ -980,11 +980,8 @@ wait untill text in selector disabppears
|
||||||
begin
|
begin
|
||||||
if instance.find_elements( { css: '.navigation .tasks .task:first-child' } )[0]
|
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] )
|
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]
|
click_element = instance.find_elements( { css: '.navigation .tasks .task:first-child .js-close' } )[0]
|
||||||
if click_element
|
if click_element
|
||||||
sleep 0.1
|
|
||||||
click_element.click
|
click_element.click
|
||||||
|
|
||||||
# accept task close warning
|
# accept task close warning
|
||||||
|
|
Loading…
Reference in a new issue