Fix hint helper for chrome
diff --git a/dev/js/src/menu.js b/dev/js/src/menu.js
index 0d5e6ac..2bc356b 100644
--- a/dev/js/src/menu.js
+++ b/dev/js/src/menu.js
@@ -75,7 +75,7 @@
},
// Arrow key and prefix treatment
- _keypress : function (e) {
+ _keydown : function (e) {
var code = _codeFromEvent(e);
switch (code) {
@@ -126,17 +126,19 @@
this.show();
e.halt();
break;
- default:
- if (e.key !== undefined &&
- e.key.length != 1)
- return;
+ };
+ },
- // Add prefix
- this._prefix.add(e.key.toLowerCase());
+ // Add characters to prefix
+ _keypress : function (e) {
+ var c = String.fromCharCode(_codeFromEvent(e)).toLowerCase();
- if (!this.show()) {
- this.prefix('').show();
- };
+ // Add prefix
+ this._prefix.add(c);
+
+ if (!this.show()) {
+ this.prefix('').show();
+ e.halt();
};
},
@@ -165,6 +167,15 @@
// Arrow keys
e.addEventListener(
+ 'keydown',
+ function (ev) {
+ that._keydown(ev)
+ },
+ false
+ );
+
+ // Strings
+ e.addEventListener(
'keypress',
function (ev) {
that._keypress(ev)