[Pkg-javascript-commits] [pdf.js] 03/174: scrollIntoView: Skip overflow:hidden elements
David Prévot
taffit at moszumanska.debian.org
Thu Nov 19 18:44:57 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository pdf.js.
commit 3e363ae30703fa979263f61665be5b05ef758ed1
Author: Rob Wu <rob at robwu.nl>
Date: Sun Sep 28 21:54:07 2014 +0200
scrollIntoView: Skip overflow:hidden elements
---
web/ui_utils.js | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/web/ui_utils.js b/web/ui_utils.js
index e58b771..0e652ab 100644
--- a/web/ui_utils.js
+++ b/web/ui_utils.js
@@ -116,13 +116,14 @@ function scrollIntoView(element, spot) {
// hidden iframe or object). We have to scroll: if the offsetParent is not set
// producing the error. See also animationStartedClosure.
var parent = element.offsetParent;
- var offsetY = element.offsetTop + element.clientTop;
- var offsetX = element.offsetLeft + element.clientLeft;
if (!parent) {
console.error('offsetParent is not set -- cannot scroll');
return;
}
- while (parent.clientHeight === parent.scrollHeight) {
+ var offsetY = element.offsetTop + element.clientTop;
+ var offsetX = element.offsetLeft + element.clientLeft;
+ while (parent.clientHeight === parent.scrollHeight ||
+ getComputedStyle(parent).overflow === 'hidden') {
if (parent.dataset._scaleY) {
offsetY /= parent.dataset._scaleY;
offsetX /= parent.dataset._scaleX;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git
More information about the Pkg-javascript-commits
mailing list