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

33 lines
501 B
JavaScript
Raw Normal View History

2016-09-26 09:28:47 +00:00
2022-06-06 17:13:57 +00:00
module.exports = new Class({
Extends: Htk.Field
,Tag: 'htk-textarea'
2022-11-16 01:46:44 +00:00
,render() {
2022-06-06 17:13:57 +00:00
var node = this.createRoot('textarea');
node.addEventListener('change', this.changed.bind(this));
}
2022-11-16 01:46:44 +00:00
,changed() {
var value;
if (this.node.value == '')
value = null;
else
value = this.node.value;
2022-06-06 17:13:57 +00:00
this.valueChanged(value);
}
2022-11-16 01:46:44 +00:00
,setEditable(editable) {
this.node.readOnly = !editable;
}
2022-11-16 01:46:44 +00:00
,putValue(value) {
if (!value)
this.node.value = '';
else
this.node.value = value;
}
});