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

27 lines
480 B
JavaScript
Raw Normal View History

2016-09-26 09:28:47 +00:00
2022-06-06 16:02:17 +00:00
module.exports = new Class({
Extends: Htk.Field
,Tag: 'htk-check'
2022-06-06 16:02:17 +00:00
,render: function() {
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));
}
2022-06-06 16:02:17 +00:00
,changed: function() {
this.valueChanged(this.node.checked);
}
2022-06-06 16:02:17 +00:00
,putValue: function(value) {
if (value)
this.node.checked = true;
else
this.node.checked = false;
}
2022-06-06 16:02:17 +00:00
,setEditable: function(editable) {
this.node.disabled = !editable;
}
});