Commit bef66b21 authored by jelles's avatar jelles
Browse files

Issue #2279399 by kevinsar: Fixed AJAX Rebinding results in looping scrollTop animation.

parent 6cc75580
......@@ -366,19 +366,29 @@
}
}
if (self.forms[f].general.scrollTo) {
var x;
if ($("#" + errorel).length) {
$("#" + errorel).show();
x = $("#" + errorel).offset().top - $("#" + errorel).height() - 100; // provides buffer in viewport
}
else {
x = $(validator.errorList[0].element).offset().top - $(validator.errorList[0].element).height() - 100;
if (!$('html, body').hasClass('cv-scrolling')) {
var x;
if ($("#" + errorel).length) {
$("#" + errorel).show();
x = $("#" + errorel).offset().top - $("#" + errorel).height() - 100; // provides buffer in viewport
}
else {
x = $(validator.errorList[0].element).offset().top - $(validator.errorList[0].element).height() - 100;
}
$('html, body').addClass('cv-scrolling').animate(
{scrollTop: x},
{
duration: self.forms[f].general.scrollSpeed,
complete: function () {
$('html, body').removeClass('cv-scrolling')
}
}
);
$('.wysiwyg-toggle-wrapper a').each(function() {
$(this).click();
$(this).click();
});
}
$('html, body').animate({scrollTop: x}, self.forms[f].general.scrollSpeed);
$('.wysiwyg-toggle-wrapper a').each(function() {
$(this).click();
$(this).click();
});
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment