From 615f8a79f91f1d868465a6dae903c6710103515f Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sun, 4 Jan 2015 07:21:05 +0000 Subject: Modes; update badge on focus change. --- content_scripts/mode.coffee | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'content_scripts') diff --git a/content_scripts/mode.coffee b/content_scripts/mode.coffee index 01427914..64001eaa 100644 --- a/content_scripts/mode.coffee +++ b/content_scripts/mode.coffee @@ -60,6 +60,10 @@ class Mode func() mode.exit() +# We need to detect when the focused frame/tab changes, and update the badge. +handlerStack.push + "focus": -> handlerStack.alwaysContinueBubbling -> Mode.updateBadge() + # A SingletonMode is a Mode of which there may be at most one instance (of @singleton) active at any one time. # New instances cancel previous instances on startup. class SingletonMode extends Mode @@ -116,5 +120,4 @@ class ConstrainedMode extends Mode root = exports ? window root.Mode = Mode root.SingletonMode = SingletonMode -root.MultiMode = MultiMode root.ConstrainedMode = ConstrainedMode -- cgit v1.2.3