2016-09-26 09:28:47 +00:00
|
|
|
|
|
|
|
module.exports = new Class
|
2015-01-23 13:09:30 +00:00
|
|
|
({
|
|
|
|
Extends: Htk.Field
|
|
|
|
,Tag: 'htk-textarea'
|
|
|
|
|
|
|
|
,initialize: function (props)
|
|
|
|
{
|
|
|
|
this.createElement ('textarea');
|
|
|
|
this.node.addEventListener ('change', this.changed.bind (this));
|
2015-11-09 08:14:33 +00:00
|
|
|
|
|
|
|
this.parent (props);
|
2015-01-23 13:09:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
,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;
|
|
|
|
}
|
|
|
|
});
|