aboutsummaryrefslogtreecommitdiffstats
path: root/content_scripts/mode.coffee
diff options
context:
space:
mode:
authorStephen Blott2015-01-05 13:33:55 +0000
committerStephen Blott2015-01-05 13:51:56 +0000
commitf2cc3b3e870e3c0c6946a675b7971e128bf9e824 (patch)
tree7cf33e1e2dc8f781a46ae03e9ae9dca8d31231f3 /content_scripts/mode.coffee
parentedd52393cc9897a74d2ea94001cafe55dec09433 (diff)
downloadvimium-f2cc3b3e870e3c0c6946a675b7971e128bf9e824.tar.bz2
Modes; minor tweeks.
Diffstat (limited to 'content_scripts/mode.coffee')
-rw-r--r--content_scripts/mode.coffee10
1 files changed, 5 insertions, 5 deletions
diff --git a/content_scripts/mode.coffee b/content_scripts/mode.coffee
index 30136315..e5795190 100644
--- a/content_scripts/mode.coffee
+++ b/content_scripts/mode.coffee
@@ -140,17 +140,17 @@ class ExitOnEscapeMode extends SingletonMode
event: event
@suppressEvent
-# When @element loses the focus.
+# Exit mode when @constrainingElement (if defined) loses the focus.
class ConstrainedMode extends ExitOnEscapeMode
- constructor: (@element, singleton, options) ->
+ constructor: (@constrainingElement, singleton, options) ->
super singleton, options
- if @element
- @element.focus()
+ if @constrainingElement
+ @constrainingElement.focus()
@push
"blur": (event) =>
handlerStack.alwaysContinueBubbling =>
- @exit() if event.srcElement == @element
+ @exit() if event.srcElement == @constrainingElement
# The state mode tracks the enabled state in @enabled and @passKeys, and its initialized state in
# @initialized. It calls @registerStateChange() whenever the state changes.