0
1
Fork 0
hedera-web-mindshore/js/htk/component.js

50 lines
814 B
JavaScript
Raw Normal View History

2016-10-16 14:16:08 +00:00
var Widget = require ('./widget');
module.exports = new Class
({
Extends: Widget
,builder: null
,builderInit: function (path)
{
var builder = new Vn.Builder ();
builder.signalData = this;
builder.loadXml (path, this.doc);
this.builderResultInit (builder);
}
,builderInitString: function (xmlString)
{
var builder = new Vn.Builder ();
builder.signalData = this;
builder.loadFromString (xmlString, this.doc);
this.builderResultInit (builder);
}
,builderResultInit: function (builder)
{
var res = this.builder = builder.load ();
this._node = res.$('main');
res.link ();
}
,$: function (id)
{
if (this.builder)
return this.builder.getById (id);
return null;
}
,_destroy: function ()
{
if (this.builder)
this.builder.unref ();
this.parent ();
}
});