diff options
| author | Stephen Blott | 2015-01-31 08:02:46 +0000 |
|---|---|---|
| committer | Stephen Blott | 2015-01-31 08:07:38 +0000 |
| commit | 90d2addc9b8f95f9272f8c2a77bdaf9dfebc0fa8 (patch) | |
| tree | c792f22c93fd3ac8c624d9fdb1a29bb1d1133368 | |
| parent | 5e8b70b1932d845af7844ab3987bf5e921c56fae (diff) | |
| download | vimium-90d2addc9b8f95f9272f8c2a77bdaf9dfebc0fa8.tar.bz2 | |
Fix scrolling issue.
On this page:
- http://www.steephill.tv/dubai-tour/
I was seeing a scrolling problem in my live browser (j/k didn't work
until I clicked on the page), but couldn't reproduce it directly in my
test browser. That's worrying.
Nevertheless, what was happening was that we succeeded in scrolling a
test amount in one direction, but the scroll to revert failed. The
consequence was that we concluded (incorrectly) that the element doesn't
scroll. And j/k scrolling is broken as a result.
How can it be that a scroll in one direction succeeds, but the reverse
does not?
This fixes the problem by not checking whether we are able to undo the
scroll of our test amount.
| -rw-r--r-- | content_scripts/scroller.coffee | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/content_scripts/scroller.coffee b/content_scripts/scroller.coffee index 6e2e1ffc..b9e7d76a 100644 --- a/content_scripts/scroller.coffee +++ b/content_scripts/scroller.coffee @@ -75,7 +75,11 @@ doesScroll = (element, direction, amount, factor) -> # definitely scrolling backwards, so a delta of -1 will do. For absolute scrolls, factor is always 1. delta = factor * getDimension(element, direction, amount) || -1 delta = getSign delta # 1 or -1 - performScroll(element, direction, delta) and performScroll(element, direction, -delta) + for change in [ delta, -delta ] + if performScroll element, direction, change + performScroll element, direction, -change + return true + false # From element and its parents, find the first which we should scroll and which does scroll. findScrollableElement = (element, direction, amount, factor) -> |
