aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Blott2015-08-22 11:50:36 +0100
committerStephen Blott2015-08-22 11:50:36 +0100
commit99c8eb517b89a7c1acc4d4f28dde1ce6f5c7713f (patch)
treeb341440b944a3a89a8676f56b1cd4dadbc7c87d3
parent207c1591073c1577c50d37cc551cb25994ceca03 (diff)
downloadvimium-99c8eb517b89a7c1acc4d4f28dde1ce6f5c7713f.tar.bz2
Prevent perpetual scroll.
If we miss the keyup event while a smooth scroll is active (because the focus changes), then we scroll forever. This stops scrolling on blur. Fixes #1788.
-rw-r--r--content_scripts/scroller.coffee3
1 files changed, 3 insertions, 0 deletions
diff --git a/content_scripts/scroller.coffee b/content_scripts/scroller.coffee
index 81c71fcd..271a7854 100644
--- a/content_scripts/scroller.coffee
+++ b/content_scripts/scroller.coffee
@@ -136,6 +136,9 @@ CoreScroller =
handlerStack.alwaysContinueBubbling =>
@keyIsDown = false
@time += 1
+ blur: =>
+ handlerStack.alwaysContinueBubbling =>
+ @time += 1 if event.target == window
# Return true if CoreScroller would not initiate a new scroll right now.
wouldNotInitiateScroll: -> @lastEvent?.repeat and Settings.get "smoothScroll"