File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 366366
367367 if ( remote ) {
368368 if ( nonBlankFileInputs ) {
369+ // slight timeout so that the submit button gets properly serialized
370+ // (make it easy for event handler to serialize form without disabled values)
369371 setTimeout ( function ( ) { rails . disableFormElements ( form ) ; } , 13 ) ;
370- return rails . fire ( form , 'ajax:aborted:file' , [ nonBlankFileInputs ] ) ;
372+ var aborted = rails . fire ( form , 'ajax:aborted:file' , [ nonBlankFileInputs ] ) ;
373+
374+ // re-enable form elements if event bindings return false (canceling normal form submission)
375+ if ( ! aborted ) { setTimeout ( function ( ) { rails . enableFormElements ( form ) ; } , 13 ) ; }
376+
377+ return aborted ;
371378 }
372379
373380 // If browser does not support submit bubbling, then this live-binding will be called before direct
You can’t perform that action at this time.
0 commit comments