2016-09-26 09:28:47 +00:00
|
|
|
|
|
|
|
module.exports = new Class
|
2015-01-23 13:09:30 +00:00
|
|
|
({
|
|
|
|
Extends: Htk.Field
|
|
|
|
,Tag: 'htk-check'
|
|
|
|
|
2016-10-16 14:16:08 +00:00
|
|
|
,render: function ()
|
2015-01-23 13:09:30 +00:00
|
|
|
{
|
2016-10-16 14:16:08 +00:00
|
|
|
var node = this.createRoot ('input');
|
|
|
|
node.type = 'checkbox';
|
|
|
|
node.addEventListener ('change', this.changed.bind (this));
|
2015-01-23 13:09:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
,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;
|
|
|
|
}
|
|
|
|
});
|