summaryrefslogtreecommitdiff
path: root/src/client/view/completer.js
diff options
context:
space:
mode:
authorAlon Levy <alon@pobox.com>2015-03-08 12:15:47 +0200
committerAlon Levy <alon@pobox.com>2015-03-08 12:15:47 +0200
commit1586cf7423ba350ea3a3afaa0566afe4521904e9 (patch)
treec7c83bb7e07eb2b37382a6d2c09f05a09e249964 /src/client/view/completer.js
parente4fa918727d6583152e5b91df8873b53079f3c33 (diff)
client: fix up/down being handled both by completer and by type selector when shift pressed
Diffstat (limited to 'src/client/view/completer.js')
-rw-r--r--src/client/view/completer.js18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/client/view/completer.js b/src/client/view/completer.js
index 19ec636b..f05c40a0 100644
--- a/src/client/view/completer.js
+++ b/src/client/view/completer.js
@@ -1,10 +1,15 @@
define(
-['jquery', 'Bacon', 'util'],
-function($, Bacon, util) {
+['jquery', 'Bacon', 'util', 'consts'],
+function($, Bacon, util, consts) {
var value = util.value,
selectionStart = util.selectionStart;
+// constants
+var VK_UP = consts.VK_UP,
+ VK_DOWN = consts.VK_DOWN,
+ VK_ESCAPE = consts.VK_ESCAPE;
+
function quoted__double(string) { // quote string using double quotes
return '"' + string + '"';
}
@@ -66,16 +71,19 @@ var completer = (function (input_element, dropdown, base_config) {
input_element.keyup(function(e) {
var ret = undefined;
+ if (e.shiftKey) {
+ return ret;
+ }
switch (e.keyCode) {
- case 38: //UP
+ case VK_UP: //UP
prev_option();
ret = false;
break;
- case 40: //DOWN
+ case VK_DOWN: //DOWN
next_option();
ret = false;
break;
- case 27: // Escape
+ case VK_ESCAPE: // Escape
hide();
ret = false;
break;