From 1962bb9b98a971342c37984951333e5fb1dc8a85 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Thu, 15 Dec 2016 08:38:57 +0100 Subject: [PATCH] Improved merge dialog (increased width and prevent submit bubbling). --- .../app/controllers/_application_controller.coffee | 1 + .../javascripts/app/controllers/agent_ticket_merge.coffee | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/app/controllers/_application_controller.coffee b/app/assets/javascripts/app/controllers/_application_controller.coffee index ff5974f90..c2d0ce794 100644 --- a/app/assets/javascripts/app/controllers/_application_controller.coffee +++ b/app/assets/javascripts/app/controllers/_application_controller.coffee @@ -813,6 +813,7 @@ class App.ControllerModal extends App.Controller @onCancel(e) submit: (e) => + e.stopPropagation() e.preventDefault() @onSubmit(e) diff --git a/app/assets/javascripts/app/controllers/agent_ticket_merge.coffee b/app/assets/javascripts/app/controllers/agent_ticket_merge.coffee index e30750f23..aad33ceb4 100644 --- a/app/assets/javascripts/app/controllers/agent_ticket_merge.coffee +++ b/app/assets/javascripts/app/controllers/agent_ticket_merge.coffee @@ -3,6 +3,7 @@ class App.TicketMerge extends App.ControllerModal buttonCancel: true buttonSubmit: true head: 'Merge' + large: true shown: false constructor: -> @@ -56,11 +57,16 @@ class App.TicketMerge extends App.ControllerModal @formDisable(e) params = @formParam(e.target) + if !params.master_ticket_number + alert(App.i18n.translateInline('%s required!', 'Ticket#')) + @formEnable(e) + return + # merge tickets @ajax( id: 'ticket_merge' type: 'GET' - url: "#{@apiPath}/ticket_merge/#{@ticket.id}/#{params['master_ticket_number']}" + url: "#{@apiPath}/ticket_merge/#{@ticket.id}/#{params.master_ticket_number}" processData: true, success: (data, status, xhr) =>