From 9bc6dc0074a9e2830bb91e939d992d9f115ac68a Mon Sep 17 00:00:00 2001 From: arodic Date: Fri, 15 Apr 2011 17:23:43 -0700 Subject: [PATCH] fixed broked DOM parenting --- gui.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/gui.js b/gui.js index 8206ac1..52a1166 100644 --- a/gui.js +++ b/gui.js @@ -35,7 +35,7 @@ var GUI = function(parameters) { var resizeTimeout; - parameters.domElement ? this.domElement = parameters.domElement : this.domElement = document.createElement('div'); + this.domElement = document.createElement('div'); this.domElement.setAttribute('class', 'guidat'); this.domElement.style.width = width+'px'; @@ -177,7 +177,12 @@ var GUI = function(parameters) { this.domElement.appendChild(controllerContainer); this.domElement.appendChild(toggleButton); - + + if ( parameters.domElement ){ + GUI.autoPlace = false; + parameters.domElement.appendChild(this.domElement); + } + if (GUI.autoPlace) { if(GUI.autoPlaceContainer == null) { GUI.autoPlaceContainer = document.createElement('div'); @@ -187,7 +192,7 @@ var GUI = function(parameters) { } GUI.autoPlaceContainer.appendChild(this.domElement); } - + this.autoListenIntervalTime = 1000/60; var createListenInterval = function() {