Skip to content

Commit

Permalink
fixed asyncfunccall to prevent returning with load message if callbac…
Browse files Browse the repository at this point in the history
…k returns too quickly
  • Loading branch information
jkapelner committed Mar 14, 2014
1 parent 5a1ec40 commit ce30049
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion js/jquery.validationEngine.js
Original file line number Diff line number Diff line change
Expand Up @@ -1148,7 +1148,12 @@
}
});

return rule.alertTextLoad;
if (options.asyncInProgress[field.attr("id")]) {
return rule.alertTextLoad; //if async function is still in progress, show the loading prompt
}
else if (options.ajaxValidCache[field.attr("id")] === false) { //if the callback returned quickly and validation failed
return {status: '_error_no_prompt'}; //force our caller to fail and bail (don't change the prompt, since that was already done by the callback)
}
}
else if (options.ajaxValidCache[field.attr("id")] === false) { //if validation previously failed, but did not change
return {status: '_error_no_prompt'}; //force our caller to fail and bail (don't change the prompt)
Expand Down

0 comments on commit ce30049

Please sign in to comment.