diff options
| author | Teddy Wing | 2018-12-16 17:10:59 +0100 |
|---|---|---|
| committer | Teddy Wing | 2018-12-16 17:10:59 +0100 |
| commit | 6445135302f984600d7f0c15ad8087f6281a260b (patch) | |
| tree | 0c2796a8d07ae1b1c45be95d79ecea0060c08c29 /content_scripts | |
| parent | bd0c2114b9dd0617919d713c13658a36b87e2749 (diff) | |
| download | vimium-fix-h-l-left-right-scrolling.tar.bz2 | |
scroller.coffee(performScroll): Fix `h` `l` horizontal scrollingfix-h-l-left-right-scrolling
When scrolling horizontally, `axisName` has value `"scrollLeft"`. Since
this line checks against value `"x"` it would always fail, causing `h`
and `l` to scroll vertically up and down respectively.
Use the `direction` argument in the condition instead, which is set to
`"x"` when scrolling horizontally with `h` and `l`.
This fixes horizontal scrolling using `h` and `l`.
Diffstat (limited to 'content_scripts')
| -rw-r--r-- | content_scripts/scroller.coffee | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/content_scripts/scroller.coffee b/content_scripts/scroller.coffee index 36bbb671..079829fa 100644 --- a/content_scripts/scroller.coffee +++ b/content_scripts/scroller.coffee @@ -58,7 +58,7 @@ performScroll = (element, direction, amount) -> before = element[axisName] if typeof element.scrollBy is "function" scrollArg = behavior: "instant" - scrollArg[if axisName is "x" then "left" else "top"] = amount + scrollArg[if direction is "x" then "left" else "top"] = amount element.scrollBy scrollArg else element[axisName] += amount |
