Prevent multiple form submits.

This commit is contained in:
Martin Edenhofer 2016-01-23 11:07:52 +01:00
parent 81971899a0
commit 06a32ad071

View file

@ -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()