This commit is contained in:
George Michael Brower 2011-01-31 20:24:30 -05:00
parent 4f1fa0411b
commit b50e86c7a0
2 changed files with 4 additions and 7 deletions

3
gui.js
View File

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

View File

@ -139,7 +139,7 @@
<h2>Basic Usage</h2>
<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;
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>
<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");
var gui = new GUI();
@ -219,7 +219,7 @@ var gui = new GUI();
gui.add(someObject, "someProperty");
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>
@ -290,7 +290,7 @@ document.getElementById("my-gui-container").appendChild( gui.domElement );</pre>
<h2 class="section last">Pro tips.</h2>
<div class="collapsable">
<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>
</ol>