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

32 lines
493 B
JavaScript

module.exports = new Class
({
Extends: Htk.Field
,Tag: 'htk-check'
,render: function ()
{
var node = this.createRoot ('input');
node.type = 'checkbox';
node.addEventListener ('change', this.changed.bind (this));
}
,changed: function ()
{
this.valueChanged (this.node.checked);
}
,putValue: function (value)
{
if (value)
this.node.checked = true;
else
this.node.checked = false;
}
,setEditable: function (editable)
{
this.node.disabled = !editable;
}
});