0
1
Fork 0
hedera-web-mindshore/package/usr/share/hedera-web/pages/web/module.js

53 lines
1.0 KiB
JavaScript
Raw Normal View History

Vn.Module = new Class
({
2015-01-31 01:05:12 +00:00
initialize: function (gui, formInfo)
{
this.gui = gui;
this.conn = gui.conn;
this.hash = gui.hash;
2015-01-31 01:05:12 +00:00
this.formInfo = formInfo;
this.builder = new Vn.Builder ();
2015-01-31 01:05:12 +00:00
this.html = this.builder.addFromXml (formInfo.xml.responseXML);
var models = this.builder.getObjects ('db-model');
for (var i = 0; i < models.length; i++)
models[i].conn = this.conn;
var hashLinks = this.builder.getObjects ('vn-hash-link');
for (var i = 0; i < hashLinks.length; i++)
hashLinks[i].hash = this.hash;
gui.formHolder.appendChild (this.html);
}
/**
2015-01-31 01:05:12 +00:00
* Gets an object from the builder associated to this form.
*
* @param {string} objectId The object identifier
* @return {Object} The object, or %null if not found
**/
,get: function (objectId)
{
return this.builder.get (objectId);
}
/**
2015-01-31 01:05:12 +00:00
* Called when the form is opened.
**/
,activate: function () {}
/**
2015-01-31 01:05:12 +00:00
* Called when the form is closed.
**/
,close: function ()
{
Vn.Node.remove (this.html);
this.builder.destroy ();
}
});