|
|
@ -143,7 +143,11 @@ |
|
|
|
}); |
|
|
|
}); |
|
|
|
updateSummary($form, messages); |
|
|
|
updateSummary($form, messages); |
|
|
|
if (errors.length) { |
|
|
|
if (errors.length) { |
|
|
|
$(window).scrollTop($form.find(errors.join(',')).first().offset().top); |
|
|
|
var top = $form.find(errors.join(',')).first().offset().top; |
|
|
|
|
|
|
|
var wtop = $(window).scrollTop(); |
|
|
|
|
|
|
|
if (top < wtop || top > wtop + $(window).height) { |
|
|
|
|
|
|
|
$(window).scrollTop(top); |
|
|
|
|
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
data.validated = true; |
|
|
|
data.validated = true; |
|
|
|
var $button = data.submitObject || $form.find(':submit:first'); |
|
|
|
var $button = data.submitObject || $form.find(':submit:first'); |
|
|
|