aboutsummaryrefslogtreecommitdiffstats
path: root/content_scripts/mode.coffee
diff options
context:
space:
mode:
authorStephen Blott2015-06-10 12:53:26 +0100
committerStephen Blott2015-06-10 12:53:26 +0100
commitd0d3bf0b6ae6e76ce146e4592f3c5ee050df950e (patch)
tree8a9e528c652e70e9e82aa6b8f05143f12184cd1e /content_scripts/mode.coffee
parentd8d36179677a99e1926f4ff6f0a8009fcdf8b97f (diff)
parent76ce186850296070cd2a0a5672282bab986eca8b (diff)
downloadvimium-d0d3bf0b6ae6e76ce146e4592f3c5ee050df950e.tar.bz2
Merge branch 'link-hints-keypress' (#1722).
Diffstat (limited to 'content_scripts/mode.coffee')
-rw-r--r--content_scripts/mode.coffee6
1 files changed, 6 insertions, 0 deletions
diff --git a/content_scripts/mode.coffee b/content_scripts/mode.coffee
index ffabc111..508b1b2c 100644
--- a/content_scripts/mode.coffee
+++ b/content_scripts/mode.coffee
@@ -101,6 +101,12 @@ class Mode
"focus": (event) => @alwaysContinueBubbling =>
@exit event if DomUtils.isFocusable event.target
+ # If @options.exitOnScroll is truthy, then the mode will exit on any scroll event.
+ if @options.exitOnScroll
+ @push
+ _name: "mode-#{@id}/exitOnScroll"
+ "scroll": (event) => @alwaysContinueBubbling => @exit event
+
# Some modes are singletons: there may be at most one instance active at any time. A mode is a singleton
# if @options.singleton is truthy. The value of @options.singleton should be the key which is intended to
# be unique. New instances deactivate existing instances with the same key.