Reduced count of not needed task bar rendering again.

This commit is contained in:
Martin Edenhofer 2015-11-20 16:26:05 +01:00
parent cbca4fa849
commit 01a37e9657
8 changed files with 29 additions and 17 deletions

View file

@ -555,6 +555,13 @@ class App.Controller extends Spine.Controller
renderScreenUnauthorized: (data) ->
@html App.view('generic/error/unauthorized')(data)
metaTaskUpdate: =>
App.Delay.set(
-> App.Event.trigger 'task:render'
250
'meta-task-update'
)
class App.ControllerPermanent extends App.Controller
constructor: ->
super
@ -745,7 +752,7 @@ class App.UpdateTastbar extends App.Controller
update: (genericObject) ->
# update taskbar with new meta data
App.Event.trigger 'task:render'
@metaTaskUpdate()
class App.ControllerWidgetPermanent extends App.Controller
constructor: (params) ->

View file

@ -302,6 +302,9 @@ class App.TicketCreate extends App.Controller
# start auto save
@autosave()
# update taskbar with new meta data
@metaTaskUpdate()
localUserInfo: (e) =>
params = App.ControllerForm.params( $(e.target).closest('form') )

View file

@ -22,7 +22,7 @@ class App.TaskbarWidget extends App.Controller
return if !@Session.get()
tasks = App.TaskManager.all()
item_list = []
taskItems = []
for task in tasks
# collect meta data of task for task bar item
@ -32,7 +32,7 @@ class App.TaskbarWidget extends App.Controller
iconClass: 'loading'
title: App.i18n.translateInline('Loading...')
head: App.i18n.translateInline('Loading...')
worker = App.TaskManager.worker( task.key )
worker = App.TaskManager.worker(task.key)
if worker
meta = worker.meta()
@ -45,14 +45,14 @@ class App.TaskbarWidget extends App.Controller
item = {}
item.task = task
item.data = data
item_list.push item
taskItems.push item
# set title
if task.active
@title data.title
@html App.view('task_widget_tasks')(
item_list: item_list
taskItems: taskItems
)
dndOptions =
@ -69,9 +69,9 @@ class App.TaskbarWidget extends App.Controller
if !key
throw 'No such key attributes found for task item'
order.push key
App.TaskManager.reorder( order )
App.TaskManager.reorder(order)
@el.sortable( dndOptions )
@el.sortable(dndOptions)
remove: (e, key = false, force = false) =>
e.preventDefault()

View file

@ -208,8 +208,8 @@ class App.TicketZoom extends App.Controller
objectName: 'Ticket'
)
# update current task title
App.Event.trigger 'task:render'
# update taskbar with new meta data
@metaTaskUpdate()
)
@ -278,7 +278,8 @@ class App.TicketZoom extends App.Controller
render: =>
# update taskbar with new meta data
App.Event.trigger 'task:render'
@metaTaskUpdate()
@formEnable( @$('.submit') )
if !@renderDone

View file

@ -51,7 +51,7 @@ class App.TicketZoomTitle extends App.Controller
App.TaskManager.mute(@task_key)
# update taskbar with new meta data
App.Event.trigger 'task:render'
@metaTaskUpdate()
release: =>
App.Ticket.unsubscribe(@subscribeId)

View file

@ -64,7 +64,7 @@ class App.TaskManager
_instance ?= new _taskManagerSingleton
_instance.TaskbarId()
class _taskManagerSingleton extends Spine.Module
class _taskManagerSingleton extends App.Controller
@include App.LogInclude
constructor: (params = {}) ->
@ -217,7 +217,7 @@ class _taskManagerSingleton extends Spine.Module
@startController(params)
if !params.init
App.Event.trigger 'task:render'
@metaTaskUpdate()
startController: (params) =>
@ -324,7 +324,7 @@ class _taskManagerSingleton extends Spine.Module
# rerender taskbar
if rerender
App.Event.trigger 'task:render'
@metaTaskUpdate()
# destroy in backend storage
@taskDestroy(task)
@ -387,7 +387,7 @@ class _taskManagerSingleton extends Spine.Module
App.Taskbar.deleteAll()
# rerender task bar
App.Event.trigger 'task:render'
@metaTaskUpdate()
nextTaskUrl: =>
@ -418,7 +418,7 @@ class _taskManagerSingleton extends Spine.Module
taskUpdate: (task) ->
#@log 'notice', "UPDATE task #{task.id}", task
@tasksToUpdate[ task.key ] = 'toUpdate'
App.Event.trigger 'task:render'
@metaTaskUpdate()
taskUpdateLoop: =>
return if @offlineModus

View file

@ -1,4 +1,4 @@
<% for item in @item_list: %>
<% for item in @taskItems: %>
<a href="<%- item.data.url %>" title="<%= item.data.title %>" class="nav-tab task <%= item.data.class %><% if item.task.active: %> is-active<% end %><% if item.task.notify: %> is-modified<% end %>" data-key="<%- item.task.key %>">
<div class="nav-tab-icon" title="<%- @Ti(item.data.iconTitle) %>">
<% if item.data.type is 'task': %>

View file

@ -980,6 +980,7 @@ 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.1
click_element = instance.find_elements( { css: '.navigation .tasks .task:first-child .js-close' } )[0]
if click_element
click_element.click