forked from verdnatura/hedera-web
27 lines
440 B
JavaScript
27 lines
440 B
JavaScript
|
|
module.exports = new Class({
|
|
Extends: Htk.Field
|
|
,Tag: 'htk-check'
|
|
|
|
,render() {
|
|
var node = this.createRoot('input');
|
|
node.type = 'checkbox';
|
|
node.addEventListener('change', this.changed.bind(this));
|
|
}
|
|
|
|
,changed() {
|
|
this.valueChanged(this.node.checked);
|
|
}
|
|
|
|
,putValue(value) {
|
|
if (value)
|
|
this.node.checked = true;
|
|
else
|
|
this.node.checked = false;
|
|
}
|
|
|
|
,setEditable(editable) {
|
|
this.node.disabled = !editable;
|
|
}
|
|
});
|