File tree Expand file tree Collapse file tree 2 files changed +11
-11
lines changed
Expand file tree Collapse file tree 2 files changed +11
-11
lines changed Original file line number Diff line number Diff line change 55 var disableFormSubmit = function ( ) {
66 return false ;
77 } ,
8+ lastFormEvent = null ,
89 HaltManager = {
910 numHalted : 0 ,
1011 haltValidation : function ( $form ) {
4849 if ( eventContext === 'keyup' ) {
4950 return null ;
5051 } else if ( this . isRunning ) {
51- if ( ! this . haltedFormValidation && eventContext === 'submit' ) {
52+ lastFormEvent = eventContext ;
53+ if ( ! this . haltedFormValidation ) {
5254 HaltManager . haltValidation ( ) ;
5355 this . haltedFormValidation = true ;
5456 }
5759 //this.$input.one('keyup change paste', this.reset.bind(this));
5860 return this . result ;
5961 } else {
60- if ( eventContext === 'submit' ) {
61- HaltManager . haltValidation ( this . $form ) ;
62- this . haltedFormValidation = true ;
63- }
62+ lastFormEvent = eventContext ;
63+ HaltManager . haltValidation ( this . $form ) ;
64+ this . haltedFormValidation = true ;
6465 this . isRunning = true ;
6566 this . $input
6667 . attr ( 'disabled' , 'disabled' )
8586 this . $form . removeClass ( 'async-validation' ) ;
8687 if ( this . haltedFormValidation ) {
8788 HaltManager . unHaltValidation ( this . $form ) ;
88- this . $form . trigger ( 'submit' ) ;
89- } else {
90- this . $input . trigger ( 'validation.revalidate' ) ;
89+ if ( lastFormEvent == 'submit' ) {
90+ this . $form . trigger ( 'submit' ) ;
91+ } else {
92+ this . $input . trigger ( 'validation.revalidate' ) ;
93+ }
9194 }
9295 } ;
9396
Original file line number Diff line number Diff line change 397397 $input . removeClass ( 'validating-server-side' ) ;
398398 if ( response . message ) {
399399 $input . attr ( conf . validationErrorMsgAttribute , response . message ) ;
400- $input . one ( 'validation' , function ( ) {
401- $input . removeAttr ( conf . validationErrorMsgAttribute ) ;
402- } ) ;
403400 }
404401 done ( response . valid ) ;
405402 } ) ;
You can’t perform that action at this time.
0 commit comments