hedera-web/js/vn/lot.js

67 lines
885 B
JavaScript
Raw Normal View History

2016-12-23 08:57:49 +00:00
2017-04-10 16:23:40 +00:00
var Object = require ('./object');
var LotIface = require ('./lot-iface');
2016-12-23 08:57:49 +00:00
module.exports = new Class
({
2017-04-10 16:23:40 +00:00
Extends: Object
,Implements: LotIface
,Tag: 'vn-lot'
,Properties:
2017-03-30 11:44:53 +00:00
{
params:
{
type: Object
2017-04-10 16:23:40 +00:00
,set: function (x)
{
this._params = x;
this.changed ();
}
,get: function ()
{
return this._params;
}
2017-03-30 11:44:53 +00:00
}
}
2017-04-10 16:23:40 +00:00
,initialize: function (props)
{
this._params = {};
this.parent (props);
}
2017-03-30 11:44:53 +00:00
2017-04-10 16:23:40 +00:00
,get: function (paramName)
{
return this._params[paramName];
}
2016-12-23 08:57:49 +00:00
2017-04-10 16:23:40 +00:00
,set: function (paramName, value)
{
this._params[paramName] = value;
this.changed ();
}
2016-12-23 08:57:49 +00:00
/**
2017-04-10 16:23:40 +00:00
* Resets all values.
2016-12-23 08:57:49 +00:00
*/
2017-04-10 16:23:40 +00:00
,reset: function ()
{
this._params = {};
this.changed ();
}
,keys: function ()
2016-12-23 08:57:49 +00:00
{
2017-04-10 16:23:40 +00:00
return Object.keys (this._params);
2016-12-23 08:57:49 +00:00
}
2017-03-30 11:44:53 +00:00
2017-04-08 11:42:27 +00:00
,assign: function (object)
2017-03-30 11:44:53 +00:00
{
2017-04-08 11:42:27 +00:00
for (var key in object)
2017-04-10 16:23:40 +00:00
this._params[key] = object[key];
2017-03-30 11:44:53 +00:00
2017-04-08 11:42:27 +00:00
this.changed ();
}
2016-12-23 08:57:49 +00:00
});