hedera-web/js/htk/field/check.js

34 lines
528 B
JavaScript
Raw Normal View History

2016-09-26 09:28:47 +00:00
module.exports = new Class
({
Extends: Htk.Field
,Tag: 'htk-check'
,initialize: function (props)
{
this.createElement ('input');
this.node.type = 'checkbox';
this.node.addEventListener ('change', this.changed.bind (this));
2015-11-09 08:14:33 +00:00
this.parent (props);
}
,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;
}
});