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

33 lines
522 B
JavaScript
Executable File

Htk.Check = 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));
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;
}
});