2016-09-26 09:28:47 +00:00
|
|
|
|
2022-06-06 16:02:17 +00:00
|
|
|
module.exports = new Class({
|
2015-01-23 13:09:30 +00:00
|
|
|
Extends: Htk.Field
|
|
|
|
,Tag: 'htk-check'
|
|
|
|
|
2022-11-16 01:46:44 +00:00
|
|
|
,render() {
|
2022-06-06 16:02:17 +00:00
|
|
|
var node = this.createRoot('input');
|
2016-10-16 14:16:08 +00:00
|
|
|
node.type = 'checkbox';
|
2022-06-06 16:02:17 +00:00
|
|
|
node.addEventListener('change', this.changed.bind(this));
|
2015-01-23 13:09:30 +00:00
|
|
|
}
|
|
|
|
|
2022-11-16 01:46:44 +00:00
|
|
|
,changed() {
|
2022-06-06 16:02:17 +00:00
|
|
|
this.valueChanged(this.node.checked);
|
2015-01-23 13:09:30 +00:00
|
|
|
}
|
|
|
|
|
2022-11-16 01:46:44 +00:00
|
|
|
,putValue(value) {
|
2015-01-23 13:09:30 +00:00
|
|
|
if (value)
|
|
|
|
this.node.checked = true;
|
|
|
|
else
|
|
|
|
this.node.checked = false;
|
|
|
|
}
|
|
|
|
|
2022-11-16 01:46:44 +00:00
|
|
|
,setEditable(editable) {
|
2015-01-23 13:09:30 +00:00
|
|
|
this.node.disabled = !editable;
|
|
|
|
}
|
|
|
|
});
|