Allow hotkeys to submit

This commit is contained in:
Bryan Ashby 2015-12-23 19:08:24 -07:00
parent 30a69b2779
commit e8c8975f13
4 changed files with 35 additions and 16 deletions

View file

@ -62,6 +62,12 @@ ToggleMenuView.prototype.redraw = function() {
}
};
ToggleMenuView.prototype.setFocusItemIndex = function(index) {
ToggleMenuView.super_.prototype.setFocusItemIndex.call(this, index); // sets this.focusedItemIndex
this.updateSelection();
};
ToggleMenuView.prototype.setFocus = function(focused) {
ToggleMenuView.super_.prototype.setFocus.call(this, focused);
@ -93,14 +99,6 @@ ToggleMenuView.prototype.onKeyPress = function(ch, key) {
}
}
if(ch && this.hotKeys) {
var keyIndex = this.hotKeys[this.caseInsensitiveHotKeys ? ch.toLowerCase() : ch];
if(_.isNumber(keyIndex)) {
this.focusedItemIndex = keyIndex;
this.updateSelection();
}
}
ToggleMenuView.super_.prototype.onKeyPress.call(this, ch, key);
};