Improved collecting of meta data, fixed race condition.
This commit is contained in:
parent
aeb288d5e5
commit
35ffe2c6dd
4 changed files with 13 additions and 13 deletions
|
@ -57,11 +57,6 @@ 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()
|
||||
if subject
|
||||
text = "#{text}: #{subject}"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -37,8 +37,6 @@ class App.TicketZoom extends App.Controller
|
|||
meta: =>
|
||||
meta =
|
||||
url: @url()
|
||||
head: '???'
|
||||
title: '???'
|
||||
id: @ticket_id
|
||||
if @ticket
|
||||
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().parent().find('.reset-message').show()
|
||||
App.TaskManager.update( @task_key, { 'state': currentData })
|
||||
@interval( update, 2800, 'autosave' )
|
||||
@interval( update, 3000, 'autosave' )
|
||||
|
||||
update: (e) =>
|
||||
e.preventDefault()
|
||||
|
|
|
@ -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'
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue