mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-07-23 19:20:41 +02:00
Menu items can now be arrays of objects
* Allows custom members of each item * 'data' overrides selection (vs returning the index) * 'text' is the default member for text if no formatters are supplied * formatters: 'itemFormat' and 'focusItemFormat', e.g. "{member1} - {member2}"
This commit is contained in:
parent
974ee1b389
commit
7a2df56855
4 changed files with 77 additions and 31 deletions
|
@ -113,9 +113,9 @@ ToggleMenuView.prototype.getData = function() {
|
|||
};
|
||||
|
||||
ToggleMenuView.prototype.setItems = function(items) {
|
||||
items = items.slice(0, 2); // switch/toggle only works with two elements
|
||||
|
||||
ToggleMenuView.super_.prototype.setItems.call(this, items);
|
||||
|
||||
this.items = this.items.splice(0, 2); // switch/toggle only works with two elements
|
||||
|
||||
this.dimens.width = this.items.join(' / ').length; // :TODO: allow configurable seperator... string & color, e.g. styleColor1 (same as fillChar color)
|
||||
this.dimens.width = items.join(' / ').length; // :TODO: allow configurable seperator... string & color, e.g. styleColor1 (same as fillChar color)
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue