aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2018-12-16 17:10:59 +0100
committerTeddy Wing2018-12-16 17:10:59 +0100
commit6445135302f984600d7f0c15ad8087f6281a260b (patch)
tree0c2796a8d07ae1b1c45be95d79ecea0060c08c29
parentbd0c2114b9dd0617919d713c13658a36b87e2749 (diff)
downloadvimium-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`.
-rw-r--r--content_scripts/scroller.coffee2
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