diff options
| -rw-r--r-- | content_scripts/scroller.coffee | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/content_scripts/scroller.coffee b/content_scripts/scroller.coffee index d3716a46..a2617289 100644 --- a/content_scripts/scroller.coffee +++ b/content_scripts/scroller.coffee @@ -34,13 +34,12 @@ getDimension = (el, direction, amount) -> else amount -# Perform a scroll. Return true if we successfully scrolled by the requested amount, and false otherwise. +# Perform a scroll. Return true if we successfully scrolled by any amount, and false otherwise. performScroll = (element, direction, amount) -> axisName = scrollProperties[direction].axisName before = element[axisName] element[axisName] += amount - scrollChange = element[axisName] - before - Math.abs(scrollChange - amount) <= 4 # At 25% zoom the scroll can be off by as much as 4. + element[axisName] != before # Test whether `element` should be scrolled. E.g. hidden elements should not be scrolled. shouldScroll = (element, direction) -> |
