Merge branch 'master' of github.com:jonobr1/gui-dat

This commit is contained in:
Jono Brandel 2011-01-31 19:06:50 -08:00
commit 3102d9b83c
2 changed files with 5 additions and 8 deletions

3
gui.js
View File

@ -458,7 +458,6 @@ var GUI = function() {
}, 0); }, 0);
if (GUI.scrollTop > -1) { if (GUI.scrollTop > -1) {
console.log("hey");
document.body.scrollTop = GUI.scrollTop; document.body.scrollTop = GUI.scrollTop;
} }
resizeTo = openHeight; resizeTo = openHeight;
@ -490,11 +489,9 @@ GUI.scrollTop = -1;
// TODO: Not working in FF. // TODO: Not working in FF.
GUI.load = function(saveString) { GUI.load = function(saveString) {
console.log(saveString);
//GUI.savedAppearanceVars = []; //GUI.savedAppearanceVars = [];
var vals = saveString.split(","); var vals = saveString.split(",");
console.log(vals);
var numGuis = parseInt(vals[0]); var numGuis = parseInt(vals[0]);
GUI.scrollTop = parseInt(vals[1]); GUI.scrollTop = parseInt(vals[1]);
for (var i = 0; i < numGuis; i++) { for (var i = 0; i < numGuis; i++) {

View File

@ -139,7 +139,7 @@
<h2>Basic Usage</h2> <h2>Basic Usage</h2>
<pre id="demo-pre" class="prettyprint"> <pre id="demo-pre" class="prettyprint">
&lt;script type="text/javascript" src="demo/demo.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="gui.min.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt; &lt;script type="text/javascript"&gt;
window.onload = function() { window.onload = function() {
@ -210,7 +210,7 @@ gui.add(GUI, "showSaveString");</pre>
<p>Clicking the "showSaveString" button bring up an alert with a string. Copy and paste that string into the method <code>GUI.load()</code> before you instantiate any gui objects.</p> <p>Clicking the "showSaveString" button bring up an alert with a string. Copy and paste that string into the method <code>GUI.load()</code> before you instantiate any gui objects.</p>
<pre class="prettyprint"> <pre class="prettyprint">
// Replace COPIED STRING with the value you got from // Replace COPIED STRING with the value you got from showSaveString()
GUI.load("COPIED STRING"); GUI.load("COPIED STRING");
var gui = new GUI(); var gui = new GUI();
@ -219,7 +219,7 @@ var gui = new GUI();
gui.add(someObject, "someProperty"); gui.add(someObject, "someProperty");
gui.add(someObject, "someOtherProperty");</pre> gui.add(someObject, "someOtherProperty");</pre>
<p><strong>Save strings won't work if you change the order in which you've added properties to your gui objects</strong>. If you want to add more parameters to your gui and use an old save string, make sure they're added after the properties whose values you've saved.</p> <p><strong>Save strings won't work if you change the order in which you've added properties to your gui objects, or the order of the gui objects themselves.</strong>. If you want to add more parameters to your gui and use an old save string, make sure they're added after the properties whose values you've saved.</p>
</div> </div>
</div> </div>
@ -290,9 +290,9 @@ document.getElementById("my-gui-container").appendChild( gui.domElement );</pre>
<h2 class="section last">Pro tips.</h2> <h2 class="section last">Pro tips.</h2>
<div class="collapsable"> <div class="collapsable">
<ol id="secrets"> <ol id="secrets">
<li><strong>gui-dat</strong> panels are resizeable. Drag the toggle button.</li> <li><strong>gui-dat</strong> panels are resizeable. Drag the show/hide button.</li>
<li>Press <strong>H</strong> to make panels invisible. Then press <strong>H</strong> to show them again.</li> <li>Pro tip #2 forthcoming.</li>
</ol> </ol>
</div> </div>
</div> </div>