* isSpecialKeyMapped() renamed to isKeyMapped()

* Functional HorizontalMenuView
* Minor updates
This commit is contained in:
Bryan Ashby 2015-07-01 20:18:34 -06:00
parent a1b87c7a60
commit c1469a1f9c
11 changed files with 81 additions and 23 deletions

View file

@ -26,7 +26,7 @@ function SpinnerMenuView(options) {
*/
this.updateSelection = function() {
assert(!self.positionCacheExpired);
//assert(!self.positionCacheExpired);
assert(this.focusedItemIndex >= 0 && this.focusedItemIndex <= self.items.length);
@ -66,7 +66,7 @@ SpinnerMenuView.prototype.setFocus = function(focused) {
SpinnerMenuView.prototype.onKeyPress = function(ch, key) {
if(key) {
if(this.isSpecialKeyMapped('up', key.name)) {
if(this.isKeyMapped('up', key.name)) {
if(0 === this.focusedItemIndex) {
this.focusedItemIndex = this.items.length - 1;
} else {
@ -75,7 +75,7 @@ SpinnerMenuView.prototype.onKeyPress = function(ch, key) {
this.updateSelection();
return;
} else if(this.isSpecialKeyMapped('down', key.name)) {
} else if(this.isKeyMapped('down', key.name)) {
if(this.items.length - 1 === this.focusedItemIndex) {
this.focusedItemIndex = 0;
} else {