marko/lib/WidgetDef.js
2014-06-04 22:22:22 -06:00

26 lines
624 B
JavaScript

function WidgetDef(config, endFunc) {
this.module = config.module;
this.id = config.id;
this.assignedId = config.assignedId;
this.config = config.config;
this.scope = config.scope;
this.events = config.events;
this.parent = config.parent;
this.children = [];
this.end = endFunc;
}
WidgetDef.prototype = {
addChild: function (widgetDef) {
this.children.push(widgetDef);
},
elId: function (name) {
if (arguments.length === 0) {
return this.id;
} else {
return this.id + '-' + name;
}
}
};
module.exports = WidgetDef;