aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Blott2014-11-13 21:37:04 +0000
committerStephen Blott2014-11-13 21:37:04 +0000
commit3816ff9438a73233bdea2512f51439306a1be156 (patch)
treec007dc6a1b7c9703fdb291a46c74b4b82e1188b6
parentc69b2efaabfb5192bbf3f8488649513953fb7344 (diff)
downloadvimium-3816ff9438a73233bdea2512f51439306a1be156.tar.bz2
Smooth scroll; admit count prefixes.
-rw-r--r--content_scripts/scroller.coffee11
1 files changed, 3 insertions, 8 deletions
diff --git a/content_scripts/scroller.coffee b/content_scripts/scroller.coffee
index c69ca235..ed024724 100644
--- a/content_scripts/scroller.coffee
+++ b/content_scripts/scroller.coffee
@@ -88,7 +88,6 @@ checkVisibility = (element) ->
doScrollBy = do ->
# This is logical time. Time is advanced each time an animator is activated, and on each keyup event.
time = 0
- mostRecentActivationTime = -1
lastEvent = null
keyHandler = null
@@ -108,14 +107,10 @@ doScrollBy = do ->
checkVisibility element
return
- if mostRecentActivationTime == time or lastEvent?.repeat
- # Either the most-recently activated animator has not yet received its keyup event (so it's still
- # scrolling), or this is a keyboard repeat (for which we don't initiate a new animator).
- # NOTE(smblott) We need both of these checks because sometimes (perhaps one time in twenty) the last
- # keyboard repeat arrives *after* the corresponding keyup.
- return
+ # We don't activate new animators on keyboard repeats.
+ return if lastEvent?.repeat
- mostRecentActivationTime = activationTime = ++time
+ activationTime = ++time
isKeyStillDown = ->
time == activationTime