Prevent multi submit.

This commit is contained in:
Martin Edenhofer 2013-10-02 00:42:36 +02:00
parent 5f46b3f730
commit 11973b9b28

View file

@ -7,12 +7,9 @@ class App.TicketMerge extends App.ControllerModal
# merge tickets # merge tickets
@ajax( @ajax(
id: 'ticket_merge_list', id: 'ticket_merge_list'
type: 'GET', type: 'GET'
url: @apiPath + '/ticket_merge_list/' + @ticket_id, url: @apiPath + '/ticket_merge_list/' + @ticket_id
data: {
# view: @view
}
processData: true, processData: true,
success: (data, status, xhr) => success: (data, status, xhr) =>
@ -99,6 +96,9 @@ class App.TicketMerge extends App.ControllerModal
submit: (e) => submit: (e) =>
e.preventDefault() e.preventDefault()
# disable form
@formDisable(e)
params = @formParam(e.target) params = @formParam(e.target)
# merge tickets # merge tickets
@ -127,9 +127,9 @@ class App.TicketMerge extends App.ControllerModal
# notify UI # notify UI
@notify @notify
type: 'success', type: 'success'
msg: App.i18n.translateContent( 'Ticket %s merged!', data.slave_ticket['number'] ), msg: App.i18n.translateContent( 'Ticket %s merged!', data.slave_ticket['number'] )
timeout: 4000, timeout: 4000
App.TaskManager.remove( 'Ticket-' + data.slave_ticket['id'] ) App.TaskManager.remove( 'Ticket-' + data.slave_ticket['id'] )
@ -137,9 +137,13 @@ class App.TicketMerge extends App.ControllerModal
# notify UI # notify UI
@notify @notify
type: 'error', type: 'error'
msg: App.i18n.translateContent( data['message'] ), msg: App.i18n.translateContent( data['message'] )
timeout: 6000, timeout: 6000
# error: =>
@formEnable(e)
error: =>
@formEnable(e)
) )