mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-07-22 10:45:56 +02:00
HOME/END key support in lists
This commit is contained in:
parent
1cb811576b
commit
973e10fb8b
2 changed files with 31 additions and 6 deletions
|
@ -165,7 +165,6 @@ VerticalMenuView.prototype.setFocusItemIndex = function(index) {
|
|||
};
|
||||
|
||||
VerticalMenuView.prototype.onKeyPress = function(ch, key) {
|
||||
|
||||
if(key) {
|
||||
if(this.isKeyMapped('up', key.name)) {
|
||||
this.focusPrevious();
|
||||
|
@ -173,8 +172,12 @@ VerticalMenuView.prototype.onKeyPress = function(ch, key) {
|
|||
this.focusNext();
|
||||
} else if(this.isKeyMapped('page up', key.name)) {
|
||||
this.focusPreviousPageItem();
|
||||
} else if( this.isKeyMapped('page down', key.name)) {
|
||||
} else if(this.isKeyMapped('page down', key.name)) {
|
||||
this.focusNextPageItem();
|
||||
} else if(this.isKeyMapped('home', key.name)) {
|
||||
this.focusFirst();
|
||||
} else if(this.isKeyMapped('end', key.name)) {
|
||||
this.focusLast();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -308,6 +311,16 @@ VerticalMenuView.prototype.focusNextPageItem = function() {
|
|||
return VerticalMenuView.super_.prototype.focusNextPageItem.call(this);
|
||||
};
|
||||
|
||||
VerticalMenuView.prototype.focusFirst = function() {
|
||||
this.setFocusItemIndex(0);
|
||||
return VerticalMenuView.super_.prototype.focusFirst.call(this);
|
||||
};
|
||||
|
||||
VerticalMenuView.prototype.focusLast = function() {
|
||||
this.setFocusItemIndex(this.items.length - 1);
|
||||
return VerticalMenuView.super_.prototype.focusLast.call(this);
|
||||
};
|
||||
|
||||
VerticalMenuView.prototype.setFocusItems = function(items) {
|
||||
VerticalMenuView.super_.prototype.setFocusItems.call(this, items);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue