aboutsummaryrefslogtreecommitdiffstats
path: root/content_scripts
diff options
context:
space:
mode:
authorStephen Blott2015-01-14 13:33:29 +0000
committerStephen Blott2015-01-14 14:33:59 +0000
commitab56d8bcd6686991483694d7153c4d0c9b5e513a (patch)
treeb045920e4743c4483066f3a91b246df9cb2a5642 /content_scripts
parent3e0378d0bc5d85ffec0ef49f7c421edbe9c073ec (diff)
downloadvimium-ab56d8bcd6686991483694d7153c4d0c9b5e513a.tar.bz2
Modes; fix tests.
Diffstat (limited to 'content_scripts')
-rw-r--r--content_scripts/mode.coffee6
-rw-r--r--content_scripts/mode_insert.coffee2
2 files changed, 4 insertions, 4 deletions
diff --git a/content_scripts/mode.coffee b/content_scripts/mode.coffee
index 2b35f0de..ab482e8f 100644
--- a/content_scripts/mode.coffee
+++ b/content_scripts/mode.coffee
@@ -44,7 +44,7 @@ count = 0
class Mode
# If Mode.debug is true, then we generate a trace of modes being activated and deactivated on the console, along
# with a list of the currently active modes.
- debug: true
+ debug: false
@modes: []
# Constants; short, readable names for handlerStack event-handler return values.
@@ -95,7 +95,7 @@ class Mode
if @options.exitOnBlur
@push
_name: "mode-#{@id}/exitOnBlur"
- "blur": (event) => @alwaysContinueBubbling => @exit() if event.srcElement == @options.exitOnBlur
+ "blur": (event) => @alwaysContinueBubbling => @exit() if event.target == @options.exitOnBlur
# If @options.exitOnClick is truthy, then the mode will exit on any click event.
if @options.exitOnClick
@@ -192,7 +192,7 @@ class Mode
# Return the name of the must-recently activated mode.
@top: ->
- @modes[@modes.length-1]?.name
+ @modes[@modes.length-1]
# BadgeMode is a pseudo mode for triggering badge updates on focus changes and state updates. It sits at the
# bottom of the handler stack, and so it receives state changes *after* all other modes, and can override the
diff --git a/content_scripts/mode_insert.coffee b/content_scripts/mode_insert.coffee
index 89077c6a..135df0d0 100644
--- a/content_scripts/mode_insert.coffee
+++ b/content_scripts/mode_insert.coffee
@@ -16,7 +16,7 @@ class InsertMode extends Mode
@insertModeLock = if options.targetElement? then options.targetElement else null
@push
- "blur": => @alwaysContinueBubbling =>
+ "blur": (event) => @alwaysContinueBubbling =>
if DomUtils.isFocusable event.target
@exit event.target
Mode.updateBadge()