0
1
Fork 0
hedera-web-mindshore/js/htk/field/entry.js

41 lines
626 B
JavaScript
Raw Normal View History

2016-09-26 09:28:47 +00:00
module.exports = new Class
({
Extends: Htk.Field
,Tag: 'htk-entry'
,initialize: function (props)
{
this.createElement ('input');
this.node.type = 'text';
this.node.addEventListener ('change', this._onChange.bind (this));
2015-11-09 08:14:33 +00:00
this.parent (props);
}
,_onChange: function (event)
{
var newValue;
if (this.node.value == '')
newValue = null;
else
newValue = this.node.value;
this.valueChanged (newValue);
}
,putValue: function (value)
{
if (!value)
this.node.value = '';
else
this.node.value = value;
}
,setEditable: function (editable)
{
this.node.readOnly = !editable;
}
});