1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-19 14:48:08 +02:00

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;