made optional third argument to controller.boolean to set default value

This commit is contained in:
jonobr1 2011-03-26 11:11:28 -07:00
parent 391be6a283
commit d249ca6bb3

View File

@ -7,6 +7,14 @@ GUI.BooleanController = function() {
var input = document.createElement('input');
input.setAttribute('type', 'checkbox');
if(arguments[3]) {
input.checked = true;
this.setValue(true);
} else {
input.checked = false;
this.setValue(false);
}
this.domElement.addEventListener('click', function(e) {
input.checked = !input.checked;
e.preventDefault();