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

38 lines
559 B
JavaScript
Raw Normal View History

2016-09-26 09:28:47 +00:00
module.exports = new Class
({
Extends: Htk.Field
,Tag: 'htk-textarea'
2016-10-16 14:16:08 +00:00
,render: function ()
{
2016-10-16 14:16:08 +00:00
var node = this.createRoot ('textarea');
node.addEventListener ('change', this.changed.bind (this));
}
,changed: function (event)
{
var value;
if (this.node.value == '')
value = null;
else
value = this.node.value;
this.valueChanged (value);
}
,setEditable: function (editable)
{
this.node.readOnly = !editable;
}
,putValue: function (value)
{
if (!value)
this.node.value = '';
else
this.node.value = value;
}
});