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 5
5
var disableFormSubmit = function ( ) {
6
6
return false ;
7
7
} ,
8
+ lastFormEvent = null ,
8
9
HaltManager = {
9
10
numHalted : 0 ,
10
11
haltValidation : function ( $form ) {
48
49
if ( eventContext === 'keyup' ) {
49
50
return null ;
50
51
} else if ( this . isRunning ) {
51
- if ( ! this . haltedFormValidation && eventContext === 'submit' ) {
52
+ lastFormEvent = eventContext ;
53
+ if ( ! this . haltedFormValidation ) {
52
54
HaltManager . haltValidation ( ) ;
53
55
this . haltedFormValidation = true ;
54
56
}
57
59
//this.$input.one('keyup change paste', this.reset.bind(this));
58
60
return this . result ;
59
61
} 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 ;
64
65
this . isRunning = true ;
65
66
this . $input
66
67
. attr ( 'disabled' , 'disabled' )
85
86
this . $form . removeClass ( 'async-validation' ) ;
86
87
if ( this . haltedFormValidation ) {
87
88
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
+ }
91
94
}
92
95
} ;
93
96
Original file line number Diff line number Diff line change 397
397
$input . removeClass ( 'validating-server-side' ) ;
398
398
if ( response . message ) {
399
399
$input . attr ( conf . validationErrorMsgAttribute , response . message ) ;
400
- $input . one ( 'validation' , function ( ) {
401
- $input . removeAttr ( conf . validationErrorMsgAttribute ) ;
402
- } ) ;
403
400
}
404
401
done ( response . valid ) ;
405
402
} ) ;
You can’t perform that action at this time.
0 commit comments