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

43 lines
733 B
JavaScript

const Widget = require('./widget');
module.exports = new Class({
Extends: Widget
,scope: null
,builderInit: function(path) {
const builder = new Vn.Builder();
builder.compileFile(path);
this.builderResultInit(builder);
}
,builderInitString: function(xmlString) {
const builder = new Vn.Builder();
builder.compileString(xmlString);
this.builderResultInit(builder);
}
,builderResultInit: function(builder) {
const scope = this.scope = builder.load(this.doc, this);
scope.link();
this._node = scope.$('main');
}
,$: function(id) {
if (this.scope)
return this.scope.getById(id);
return null;
}
,_destroy: function() {
if (this.scope)
this.scope.unref();
this.parent();
}
});