From 0e60699d452ca9a4d56b2d1ba70841b94c003b54 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Tue, 23 Apr 2013 08:00:40 +0200 Subject: [PATCH] Added task auto close of merged ticket. --- .../app/controllers/agent_ticket_merge.js.coffee | 4 +++- .../javascripts/app/controllers/agent_ticket_zoom.js.coffee | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/app/controllers/agent_ticket_merge.js.coffee b/app/assets/javascripts/app/controllers/agent_ticket_merge.js.coffee index 39f655111..a512747c0 100644 --- a/app/assets/javascripts/app/controllers/agent_ticket_merge.js.coffee +++ b/app/assets/javascripts/app/controllers/agent_ticket_merge.js.coffee @@ -131,7 +131,9 @@ class App.TicketMerge extends App.ControllerModal @notify type: 'success', msg: App.i18n.translateContent( 'Ticket %s merged!', data.slave_ticket['number'] ), - timeout: 6000, + timeout: 4000, + + App.TaskManager.remove( @task_key ) else diff --git a/app/assets/javascripts/app/controllers/agent_ticket_zoom.js.coffee b/app/assets/javascripts/app/controllers/agent_ticket_zoom.js.coffee index 7b63080dc..aa9f2e52f 100644 --- a/app/assets/javascripts/app/controllers/agent_ticket_zoom.js.coffee +++ b/app/assets/javascripts/app/controllers/agent_ticket_zoom.js.coffee @@ -83,9 +83,11 @@ class App.TicketZoom extends App.Controller App.Store.write( @key, data ) error: (xhr, status, error) => + + # do not close window if request is abort or network error exists return if status is 'abort' + return if status is 'error' App.TaskManager.remove( @task_key ) - @release() ) @doNotLog = 1 @@ -599,7 +601,7 @@ class TicketActionRow extends App.Controller merge_dialog: (e) -> e.preventDefault() - new App.TicketMerge( ticket_id: @ticket.id ) + new App.TicketMerge( ticket_id: @ticket.id, task_key: @zoom.task_key ) customer_dialog: (e) -> e.preventDefault()