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,11 +57,6 @@ class App.TicketCreate extends App.Controller
meta: => meta: =>
text = App.i18n.translateInline( @article_attributes['title'] ) 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 if subject
text = "#{text}: #{subject}" text = "#{text}: #{subject}"

View file

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

View file

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

View file

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