From d249ca6bb360cf35168bf11b1c83815e5cccac9c Mon Sep 17 00:00:00 2001 From: jonobr1 Date: Sat, 26 Mar 2011 11:11:28 -0700 Subject: [PATCH] made optional third argument to controller.boolean to set default value --- controllers/controller.boolean.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/controllers/controller.boolean.js b/controllers/controller.boolean.js index 2cb68b3..1d2ceb9 100644 --- a/controllers/controller.boolean.js +++ b/controllers/controller.boolean.js @@ -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();