forked from verdnatura/hedera-web
38 lines
585 B
JavaScript
Executable File
38 lines
585 B
JavaScript
Executable File
Htk.TextArea = new Class
|
|
({
|
|
Extends: Htk.Field
|
|
,Tag: 'htk-textarea'
|
|
|
|
,initialize: function (props)
|
|
{
|
|
this.parent (props);
|
|
this.createElement ('textarea');
|
|
this.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;
|
|
}
|
|
});
|