diff options
| author | Stephen Blott | 2016-03-30 13:07:05 +0100 |
|---|---|---|
| committer | Stephen Blott | 2016-03-30 14:58:46 +0100 |
| commit | 21da3fcafbb29540788037dbcdbdce79ad14e650 (patch) | |
| tree | 0d4ff357c8cfd25226cb8dd6bf07d398ed3dfb03 /content_scripts/mode_insert.coffee | |
| parent | a2fba970e089254adae2631a5b154e6bd92ec1e2 (diff) | |
| download | vimium-21da3fcafbb29540788037dbcdbdce79ad14e650.tar.bz2 | |
Rename handlerStack constants.
Problems:
- The meanings of some of the Mode/handlerStack constant names is far
from obvious.
- The same thing is named different things in different places.
This changes various constant names such that:
- the names used in the handler stack and in the modes are the same.
- ditto vis-a-vis DomUtils.
Also, break out the core of the handler stacks' `bubbleEvent` method
into a switch statements. This makes it more obvious that the cases are
mutually exclusive.
Diffstat (limited to 'content_scripts/mode_insert.coffee')
| -rw-r--r-- | content_scripts/mode_insert.coffee | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/content_scripts/mode_insert.coffee b/content_scripts/mode_insert.coffee index f86038d6..9cab52e1 100644 --- a/content_scripts/mode_insert.coffee +++ b/content_scripts/mode_insert.coffee @@ -16,7 +16,7 @@ class InsertMode extends Mode new PassNextKeyMode return false - return @stopBubblingAndTrue unless event.type == 'keydown' and KeyboardUtils.isEscape event + return @passEventToPage unless event.type == 'keydown' and KeyboardUtils.isEscape event DomUtils.suppressKeyupAfterEscape handlerStack target = event.srcElement if target and DomUtils.isFocusable target @@ -115,19 +115,19 @@ class PassNextKeyMode extends Mode # We exit on blur because, once we lose the focus, we can no longer track key events. exitOnBlur: window keypress: => - @stopBubblingAndTrue + @passEventToPage keydown: => seenKeyDown = true keyDownCount += 1 - @stopBubblingAndTrue + @passEventToPage keyup: => if seenKeyDown unless 0 < --keyDownCount unless 0 < --count @exit() - @stopBubblingAndTrue + @passEventToPage root = exports ? window root.InsertMode = InsertMode |
