diff options
| author | mrmr1993 | 2017-11-14 11:31:11 +0000 |
|---|---|---|
| committer | mrmr1993 | 2017-11-14 11:45:55 +0000 |
| commit | de0c06e180690a0101b4dda92e3164fa198485fd (patch) | |
| tree | f3ee54fe016090f66bbfb9cc9e7313f8c976c853 /content_scripts | |
| parent | 1880062f68e6f4280b7257f3cd437c0aee7c9696 (diff) | |
| download | vimium-de0c06e180690a0101b4dda92e3164fa198485fd.tar.bz2 | |
Start searching for scrollable elements from <body> whenever possible
Diffstat (limited to 'content_scripts')
| -rw-r--r-- | content_scripts/scroller.coffee | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/content_scripts/scroller.coffee b/content_scripts/scroller.coffee index 4a6c7edf..e2e05722 100644 --- a/content_scripts/scroller.coffee +++ b/content_scripts/scroller.coffee @@ -95,7 +95,14 @@ findScrollableElement = (element, direction, amount, factor) -> # On some pages, the scrolling element is not actually scrollable. Here, we search the document for the # largest visible element which does scroll vertically. This is used to initialize activatedElement. See # #1358. -firstScrollableElement = (element=getScrollingElement()) -> +firstScrollableElement = (element) -> + unless element + scrollingElement = getScrollingElement() + if doesScroll(scrollingElement, "y", 1, 1) or doesScroll(scrollingElement, "y", -1, 1) + return scrollingElement + else + element = document.body ? getScrollingElement() + if doesScroll(element, "y", 1, 1) or doesScroll(element, "y", -1, 1) element else |
