mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-10 14:44:40 +02:00
* isSpecialKeyMapped() renamed to isKeyMapped()
* Functional HorizontalMenuView * Minor updates
This commit is contained in:
parent
a1b87c7a60
commit
c1469a1f9c
11 changed files with 81 additions and 23 deletions
|
@ -109,7 +109,7 @@ VerticalMenuView.prototype.onKeyPress = function(ch, key) {
|
|||
if(key) {
|
||||
var prevFocusedItemIndex = this.focusedItemIndex;
|
||||
|
||||
if(this.isSpecialKeyMapped('up', key.name)) {
|
||||
if(this.isKeyMapped('up', key.name)) {
|
||||
if(0 === this.focusedItemIndex) {
|
||||
this.focusedItemIndex = this.items.length - 1;
|
||||
|
||||
|
@ -125,7 +125,7 @@ VerticalMenuView.prototype.onKeyPress = function(ch, key) {
|
|||
this.viewWindow.bottom--;
|
||||
}
|
||||
}
|
||||
} else if(this.isSpecialKeyMapped('down', key.name)) {
|
||||
} else if(this.isKeyMapped('down', key.name)) {
|
||||
if(this.items.length - 1 === this.focusedItemIndex) {
|
||||
this.focusedItemIndex = 0;
|
||||
|
||||
|
@ -144,6 +144,7 @@ VerticalMenuView.prototype.onKeyPress = function(ch, key) {
|
|||
}
|
||||
|
||||
if(prevFocusedItemIndex !== this.focusedItemIndex) {
|
||||
// :TODO: Optimize this for cases where no scrolling occured & only two items need updated
|
||||
this.redraw();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue