Prevent multiple form submits.
This commit is contained in:
parent
81971899a0
commit
06a32ad071
1 changed files with 7 additions and 4 deletions
|
@ -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()
|
||||
|
||||
|
|
Loading…
Reference in a new issue