aboutsummaryrefslogtreecommitdiffstats
path: root/content_scripts/mode.coffee
diff options
context:
space:
mode:
authorStephen Blott2015-01-12 15:46:57 +0000
committerStephen Blott2015-01-12 15:46:57 +0000
commit88e4f1587f30b928ae7cce5d9e01e93b27c87f55 (patch)
treedd847b5db9a05b28147fb1467776b8e2a60aba95 /content_scripts/mode.coffee
parentee17e7365b84d0c59ce3bcf50c517a7408b372b3 (diff)
downloadvimium-88e4f1587f30b928ae7cce5d9e01e93b27c87f55.tar.bz2
Modes; hint mode should be an insert-mode blocker...
Also: - visual-mode template should block insert. - hint mode should exit on click.
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 94854b74..51bb1c29 100644
--- a/content_scripts/mode.coffee
+++ b/content_scripts/mode.coffee
@@ -97,6 +97,12 @@ class Mode
_name: "mode-#{@id}/exitOnBlur"
"blur": (event) => @alwaysContinueBubbling => @exit() if event.srcElement == @options.exitOnBlur
+ # If @options.exitOnClick is truthy, then the mode will exit on any click event.
+ if @options.exitOnClick
+ @push
+ _name: "mode-#{@id}/exitOnClick"
+ "click": (event) => @alwaysContinueBubbling => @exit()
+
# If @options.trackState is truthy, then the mode mainatins the current state in @enabled and @passKeys,
# and calls @registerStateChange() (if defined) whenever the state changes.
if @options.trackState