diff options
| author | Stephen Blott | 2015-02-01 15:48:54 +0000 |
|---|---|---|
| committer | Stephen Blott | 2015-02-01 15:48:54 +0000 |
| commit | a9b8c4cdc176889c8ef442711109a9b5f4334c16 (patch) | |
| tree | be69020dd730339135510e54eebc450994d86f50 /content_scripts/mode.coffee | |
| parent | 68e4aa3931babdf97c5f12dc5f655415e2073402 (diff) | |
| parent | 7939b69ffc2880ff4590d1c8dcfd5eb7492200fd (diff) | |
| download | vimium-a9b8c4cdc176889c8ef442711109a9b5f4334c16.tar.bz2 | |
Merge branch 'modes-rework-dom-tests'
Diffstat (limited to 'content_scripts/mode.coffee')
| -rw-r--r-- | content_scripts/mode.coffee | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/content_scripts/mode.coffee b/content_scripts/mode.coffee index acc3978e..42ea9930 100644 --- a/content_scripts/mode.coffee +++ b/content_scripts/mode.coffee @@ -169,14 +169,19 @@ class Mode log: (args...) -> console.log args... if @debug - # Return the must-recently activated mode (only used in tests). + # For tests only. @top: -> @modes[@modes.length-1] + # For tests only. + @reset: -> + mode.exit() for mode in @modes + @modes = [] + # 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 -# badge choice of the other modes. We create the the one-and-only instance here. -new class BadgeMode extends Mode +# badge choice of the other modes. +class BadgeMode extends Mode constructor: () -> super name: "badge" @@ -200,3 +205,4 @@ new class BadgeMode extends Mode root = exports ? window root.Mode = Mode +root.BadgeMode = BadgeMode |
