mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
29 lines
624 B
JavaScript
29 lines
624 B
JavaScript
'use strict';
|
|
var extend = require('raptor-util').extend;
|
|
|
|
function WidgetDef(config) {
|
|
/*
|
|
this.type = null;
|
|
this.id = null;
|
|
this.assignedId = null;
|
|
this.config = null;
|
|
this.scope = null;
|
|
this.events = null;
|
|
this.parent = null;
|
|
*/
|
|
this.children = [];
|
|
extend(this, config);
|
|
}
|
|
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; |