aboutsummaryrefslogtreecommitdiffstats
path: root/content_scripts/mode.coffee
diff options
context:
space:
mode:
authorStephen Blott2015-01-03 15:10:06 +0000
committerStephen Blott2015-01-03 16:17:07 +0000
commit7889b3c2c68354d377c31121d6fb94f528e0454c (patch)
treea3bac7bfef47d9439934d883bfb0a5b9a46975d4 /content_scripts/mode.coffee
parentbaccd7c5cef14480e21e41519e20ee19fa238655 (diff)
downloadvimium-7889b3c2c68354d377c31121d6fb94f528e0454c.tar.bz2
Modes; simplify PostFindMode.
Diffstat (limited to 'content_scripts/mode.coffee')
-rw-r--r--content_scripts/mode.coffee5
1 files changed, 5 insertions, 0 deletions
diff --git a/content_scripts/mode.coffee b/content_scripts/mode.coffee
index 9e886a63..9126a824 100644
--- a/content_scripts/mode.coffee
+++ b/content_scripts/mode.coffee
@@ -1,4 +1,6 @@
+count = 0
+
class Mode
# Static members.
@modes: []
@@ -20,6 +22,8 @@ class Mode
constructor: (options) ->
Mode.modes.unshift @
extend @, options
+ @count = ++count
+ console.log @count, "create:", @name
@handlers = []
@handlers.push handlerStack.push
@@ -29,6 +33,7 @@ class Mode
updateBadge: (badge) => handlerStack.alwaysContinueBubbling => @chooseBadge badge
exit: ->
+ console.log @count, "exit:", @name
handlerStack.remove handlerId for handlerId in @handlers
Mode.modes = Mode.modes.filter (mode) => mode != @
Mode.updateBadge()