From 6445135302f984600d7f0c15ad8087f6281a260b Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sun, 16 Dec 2018 17:10:59 +0100 Subject: scroller.coffee(performScroll): Fix `h` `l` horizontal 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`. --- content_scripts/scroller.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit v1.2.3