Fix validations
This commit is contained in:
parent
0776c51994
commit
6449f1ca72
|
@ -374,15 +374,22 @@ Validatable.prototype.isValid = function (callback, data) {
|
|||
});
|
||||
|
||||
if (!async) {
|
||||
validationsDone.call(inst, callback);
|
||||
validationsDone.call(inst, function() {
|
||||
if (valid) cleanErrors(inst);
|
||||
if (callback) {
|
||||
callback(valid);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function done(fail) {
|
||||
asyncFail = asyncFail || fail;
|
||||
if (--wait === 0 && callback) {
|
||||
if (--wait === 0) {
|
||||
validationsDone.call(inst, function () {
|
||||
if (valid && !asyncFail) cleanErrors(inst);
|
||||
callback(valid && !asyncFail);
|
||||
if (callback) {
|
||||
callback(valid && !asyncFail);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue