diff options
| author | Alon Levy <alon@pobox.com> | 2014-12-03 14:29:53 +0200 |
|---|---|---|
| committer | Alon Levy <alon@pobox.com> | 2014-12-03 14:29:53 +0200 |
| commit | a4db7891fd130f198732068b41bf7c7dd57cd8cf (patch) | |
| tree | 7264a409f4a739464a58a44beab24439a0da3f75 | |
| parent | 5ccdb6549eb5abf3fb561f09daf88eb38f2c27f8 (diff) | |
Fixes #171, Fixes #137
One line, two changes:
keypress->keydown:
- fixes #137. Chrome doesn't dispatch a keypressed on tab. Firefox and
chrome both dispatch a keydown, so this works in both.
$(document)->element:
- fixes #171. Don't listen to text input events globally, only on the
element.
| -rw-r--r-- | src/textanalysis.ui.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/textanalysis.ui.js b/src/textanalysis.ui.js index f41ebaa5..277d847e 100644 --- a/src/textanalysis.ui.js +++ b/src/textanalysis.ui.js @@ -119,8 +119,9 @@ return { var document_keypress = new Bacon.Bus(); rz_bus.ui_key.plug(document_keypress); - $(document).keypress(function(e) { + element.keydown(function(e) { var ret = undefined; + switch (e.keyCode) { case 9: //TAB e.preventDefault(); |
