Merge pull request #2041 from yurydelendik/fix-parentnull

Fixes scrollIntoView when scrollbars are hidden
This commit is contained in:
Brendan Dahl 2012-08-28 15:35:50 -07:00
commit b1181c1d80

View File

@ -38,6 +38,8 @@ function scrollIntoView(element, spot) {
while (parent.clientHeight == parent.scrollHeight) {
offsetY += parent.offsetTop;
parent = parent.offsetParent;
if (!parent)
return; // no need to scroll
}
if (spot)
offsetY += spot.top;