mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-11 23:24:43 +02:00
* Bunch of WIP on new setPropertyValue() stuff making it easier to set props from JSON
This commit is contained in:
parent
8a5f890bee
commit
658c64c8c8
8 changed files with 202 additions and 45 deletions
|
@ -105,12 +105,23 @@ MenuView.prototype.setItems = function(items) {
|
|||
};
|
||||
|
||||
MenuView.prototype.setItemSpacing = function(itemSpacing) {
|
||||
itemSpacing = parseInt(itemSpacing);
|
||||
assert(_.isNumber(itemSpacing));
|
||||
|
||||
this.itemSpacing = itemSpacing;
|
||||
this.positionCacheExpired = true;
|
||||
};
|
||||
|
||||
MenuView.prototype.setPropertyValue = function(propName, value) {
|
||||
switch(propName) {
|
||||
case 'itemSpacing' : this.setItemSpacing(value); break;
|
||||
case 'items' : this.setItems(value); break;
|
||||
case 'hotKeys' : this.setHotKeys(value); break;
|
||||
}
|
||||
|
||||
MenuView.super_.prototype.setPropertyValue.call(this, propName, value);
|
||||
};
|
||||
|
||||
MenuView.prototype.setHotKeys = function(hotKeys) {
|
||||
if(_.isObject(hotKeys)) {
|
||||
if(this.caseInsensitiveHotKeys) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue