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.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()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue