mirror of
https://github.com/dataarts/dat.gui.git
synced 2024-12-12 04:08:27 +00:00
made optional third argument to controller.boolean to set default value
This commit is contained in:
parent
391be6a283
commit
d249ca6bb3
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user