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.stopPropagation()
e.preventDefault() e.preventDefault()
# disable form
@formDisable(e)
# validate new article # validate new article
return if !@articleNew.validate() if !@articleNew.validate()
@formEnable(e)
return
taskAction = @$('.js-secondaryActionButtonLabel').data('type') taskAction = @$('.js-secondaryActionButtonLabel').data('type')
@ -539,14 +544,12 @@ class App.TicketZoom extends App.Controller
# check if title exists # check if title exists
if !ticket['title'] if !ticket['title']
alert( App.i18n.translateContent('Title needed') ) alert( App.i18n.translateContent('Title needed') )
@formEnable(e)
return return
# submit ticket & article # submit ticket & article
@log 'notice', 'update ticket', ticket @log 'notice', 'update ticket', ticket
# disable form
@formDisable(e)
# stop autosave # stop autosave
@autosaveStop() @autosaveStop()