From 88e4f1587f30b928ae7cce5d9e01e93b27c87f55 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Mon, 12 Jan 2015 15:46:57 +0000 Subject: Modes; hint mode should be an insert-mode blocker... Also: - visual-mode template should block insert. - hint mode should exit on click. --- content_scripts/mode.coffee | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'content_scripts/mode.coffee') 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 -- cgit v1.2.3