From 06a32ad07195c8489439550b5d3afc034a7ee808 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Sat, 23 Jan 2016 11:07:52 +0100 Subject: [PATCH] Prevent multiple form submits. --- .../javascripts/app/controllers/ticket_zoom.coffee | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/app/controllers/ticket_zoom.coffee b/app/assets/javascripts/app/controllers/ticket_zoom.coffee index 70551860b..017ca4c4b 100644 --- a/app/assets/javascripts/app/controllers/ticket_zoom.coffee +++ b/app/assets/javascripts/app/controllers/ticket_zoom.coffee @@ -495,8 +495,13 @@ class App.TicketZoom extends App.Controller e.stopPropagation() e.preventDefault() + # disable form + @formDisable(e) + # validate new article - return if !@articleNew.validate() + if !@articleNew.validate() + @formEnable(e) + return taskAction = @$('.js-secondaryActionButtonLabel').data('type') @@ -539,14 +544,12 @@ class App.TicketZoom extends App.Controller # check if title exists if !ticket['title'] alert( App.i18n.translateContent('Title needed') ) + @formEnable(e) return # submit ticket & article @log 'notice', 'update ticket', ticket - # disable form - @formDisable(e) - # stop autosave @autosaveStop()