From 70c7cb66e96305b0f8bbd8687fe8272d989ed3d9 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sat, 31 Jan 2015 12:13:48 +0000 Subject: Revert "Fix scrolling issue." This reverts commit 90d2addc9b8f95f9272f8c2a77bdaf9dfebc0fa8. Nope. This is bad. It fixes the issue referred to in the commit record, but breaks scrolling out of text areas. With 90d2addc9b8f95f9272f8c2a77bdaf9dfebc0fa8: - Start editing in a text area, add enough text that it scrolls. - `Escape` - `k`, `k`, `k`, ... We expect first the text areas to scroll, then -- when it reaches the top -- the document to scroll. However, with 90d2addc9b8f95f9272f8c2a77bdaf9dfebc0fa8, we get stuck in the text area. --- content_scripts/scroller.coffee | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'content_scripts') diff --git a/content_scripts/scroller.coffee b/content_scripts/scroller.coffee index 17a49464..f26f0b73 100644 --- a/content_scripts/scroller.coffee +++ b/content_scripts/scroller.coffee @@ -75,11 +75,7 @@ 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 - for change in [ delta, -delta ] - if performScroll element, direction, change - performScroll element, direction, -change - return true - false + performScroll(element, direction, delta) and performScroll(element, direction, -delta) # From element and its parents, find the first which we should scroll and which does scroll. findScrollableElement = (element, direction, amount, factor) -> -- cgit v1.2.3