fix steps focusFirstInvalid with fadeSpeed

This commit is contained in:
elclanrs 2013-10-14 19:55:28 -04:00
parent 5d98a7aa86
commit b35d28de81
4 changed files with 9 additions and 1354 deletions

View file

@ -203,6 +203,8 @@
$('form.idealforms').idealforms({ $('form.idealforms').idealforms({
silentLoad: false,
rules: { rules: {
'username': 'required username ajax', 'username': 'required username ajax',
'email': 'required email', 'email': 'required email',
@ -225,7 +227,10 @@
onSubmit: function(invalid, e) { onSubmit: function(invalid, e) {
e.preventDefault(); e.preventDefault();
$('#invalid').show().text(invalid ? (invalid +' invalid fields') : 'All good!'); $('#invalid')
.show()
.toggleClass('valid', ! invalid)
.text(invalid ? (invalid +' invalid fields') : 'All good!');
}, },
steps: { steps: {

View file

@ -58,6 +58,8 @@ module.exports = {
return $(this).find(firstInvalid).length; return $(this).find(firstInvalid).length;
}).index(); }).index();
}); });
setTimeout(function(){ $(firstInvalid).focus() }, this.opts.steps.fadeSpeed);
}, },
_buildSteps: function() { _buildSteps: function() {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long