Improved collecting of meta data, fixed race condition.

This commit is contained in:
Martin Edenhofer 2013-08-21 10:55:35 +02:00
parent aeb288d5e5
commit 35ffe2c6dd
4 changed files with 13 additions and 13 deletions

View file

@ -57,12 +57,7 @@ class App.TicketCreate extends App.Controller
meta: =>
text = App.i18n.translateInline( @article_attributes['title'] )
if !@_initMetaDone
@_initMetaDone = true
state = App.TaskManager.get(@task_key).state
subject = state['subject']
else
subject = @el.find('[name=subject]').val()
subject = @el.find('[name=subject]').val()
if subject
text = "#{text}: #{subject}"
meta =

View file

@ -120,6 +120,8 @@ class Taskbar extends App.Controller
tasks = App.TaskManager.all()
item_list = []
for task in tasks
# collect meta data of task for task bar item
data =
url: '#'
id: false
@ -128,8 +130,13 @@ class Taskbar extends App.Controller
worker = App.TaskManager.worker( task.key )
if worker
meta = worker.meta()
# apply meta data of controller
if meta
data = meta
for key, value of meta
data[key] = value
# collect new task bar items
item = {}
item.task = task
item.data = data

View file

@ -36,10 +36,8 @@ class App.TicketZoom extends App.Controller
meta: =>
meta =
url: @url()
head: '???'
title: '???'
id: @ticket_id
url: @url()
id: @ticket_id
if @ticket
meta.head = @ticket.title
meta.title = '#' + @ticket.number + ' - ' + @ticket.title
@ -428,7 +426,7 @@ class Edit extends App.Controller
@el.find('.ticket-update').parent().addClass('form-changed')
@el.find('.ticket-update').parent().parent().find('.reset-message').show()
App.TaskManager.update( @task_key, { 'state': currentData })
@interval( update, 2800, 'autosave' )
@interval( update, 3000, 'autosave' )
update: (e) =>
e.preventDefault()

View file

@ -379,7 +379,7 @@ class _taskManagerSingleton extends App.Controller
App.Delay.set(
=>
@add(task.key, task.callback, task.params, true)
task_count * 300
task_count * 900
undefined
'task'
)