Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
default:
return elm.Button({
label: item,
on_click: this.selectedNavigationBarItem.bind(this, item)
});
}
}
if (item instanceof Controller) {
var btn = elm.Button({});
if (item.title)
btn.label = item.title;
if (item.icon)
btn.icon = elm.Icon({ image: item.icon });
switch (item) {
case this.parent:
btn.on_click = this.popController.bind(this);
break;
case this.split.left:
if (EUI.uiMode === 'tablet')
return;
btn.icon = btn.icon || elm.Icon({ image: 'apps' });
btn.on_click = function() { this.split.leftPanelVisible = true }.bind(this);
break;
default:
btn.on_click = this.selectedNavigationBarItem.bind(this, item);
}
return btn;
var btn = elm.Button({});
if (item.title)
btn.label = item.title;
if (item.icon)
btn.icon = elm.Icon({ image: item.icon });
switch (item) {
case this.parent:
btn.on_click = this.popController.bind(this);
break;
case this.split.left:
if (EUI.uiMode === 'tablet')
return;
btn.icon = btn.icon || elm.Icon({ image: 'apps' });
btn.on_click = function() { this.split.leftPanelVisible = true }.bind(this);
break;
default:
btn.on_click = this.selectedNavigationBarItem.bind(this, item);
}
return btn;
}
if (typeof(item) === 'object' && item.hasOwnProperty('label')) {
item.on_click = item.on_click || this.selectedNavigationBarItem.bind(this, item);
return elm.Button(item);
}
return item;
},
content: function() {
return elm.Icon({ image: 'refresh' });
}
},
content: function(part, data) {
if (part == 'elm.swallow.end')
return elm.Button({ label: "Delete"});
var item = this._itemFromData(data.data);
var image = item && item[part.replace('elm.swallow.', '')];
return image && elm.Icon({ image: image });
}.bind(this),
state: function(part, data) {