From e3ea9a8ce21073c216fe4c7072b134a65a381320 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Thu, 24 Mar 2016 10:29:17 +0100 Subject: [PATCH] Check if task title need to be updated. --- .../app/controllers/agent_ticket_create.coffee | 11 +++++++++-- .../javascripts/app/lib/app_post/task_manager.coffee | 2 ++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/app/controllers/agent_ticket_create.coffee b/app/assets/javascripts/app/controllers/agent_ticket_create.coffee index d29a9f7dd..f1a7aaf6e 100644 --- a/app/assets/javascripts/app/controllers/agent_ticket_create.coffee +++ b/app/assets/javascripts/app/controllers/agent_ticket_create.coffee @@ -135,6 +135,13 @@ class App.TicketCreate extends App.Controller @autosaveLast = data @log 'debug', 'form hash changed', diff, data App.TaskManager.update(@task_key, { 'state': data }) + + # check it task title in task need to be updated + title = @$('[name=title]').val() + if @latestTitle isnt title + @latestTitle = title + @metaTaskUpdate() + @interval(update, 3000, @id) # get data / in case also ticket data for split @@ -146,9 +153,9 @@ class App.TicketCreate extends App.Controller # fetch split ticket data @ajax( - id: 'ticket_split' + @task_key + id: "ticket_split#{@task_key}" type: 'GET' - url: @apiPath + '/ticket_split' + url: "#{@apiPath}/ticket_split" data: ticket_id: params.ticket_id article_id: params.article_id diff --git a/app/assets/javascripts/app/lib/app_post/task_manager.coffee b/app/assets/javascripts/app/lib/app_post/task_manager.coffee index 26a5e031e..00dd466f8 100644 --- a/app/assets/javascripts/app/lib/app_post/task_manager.coffee +++ b/app/assets/javascripts/app/lib/app_post/task_manager.coffee @@ -201,7 +201,9 @@ class _taskManagerSingleton extends App.Controller $('.nav-tab.task').each( (_index, element) => localElement = $(element) key = localElement.data('key') + return if !key task = @get(key) + return if !task if task.active localElement.addClass('is-active') else