Working on string controller

This commit is contained in:
George Michael Brower 2011-01-31 18:15:29 -05:00
parent 5bde5f79a1
commit 7501ba9839
3 changed files with 20 additions and 7 deletions

View File

@ -17,6 +17,7 @@ var StringController = function() {
input.select(); input.select();
}, false); }, false);
// TODO: getting messed up on ctrl a
input.addEventListener('keyup', function() { input.addEventListener('keyup', function() {
_this.setValue(input.value); _this.setValue(input.value);
}, false); }, false);

View File

@ -48,14 +48,18 @@ h2 {
margin-bottom: 24px; margin-bottom: 24px;
} }
h2.collapsed {
padding-top:24px;
border-top: 1px solid #ccc;
margin-top: 0;
}
/*
h2.collapsed { h2.collapsed {
float: left; float: left;
clear: both; clear: both;
padding-top:24px;
margin-top: 0;
border-top: 1px solid #ccc;
width: 100%; width: 100%;
cursor: pointer; cursor: pointer;
} }
@ -77,7 +81,7 @@ color: red;
clear: both; clear: both;
display: none; display: none;
} }*/
#helvetica-demo { #helvetica-demo {
position: absolute; position: absolute;

14
gui.js
View File

@ -26,6 +26,9 @@ var GUI = function() {
var open = false; var open = false;
var width = 280; var width = 280;
// Prevents checkForOverflow bug in which loaded gui appearance
// settings are not respected by presence of scrollbar.
var explicitOpenHeight = false; var explicitOpenHeight = false;
var openHeight; var openHeight;
@ -315,7 +318,11 @@ var GUI = function() {
// Compute sum height of controllers. // Compute sum height of controllers.
checkForOverflow(); checkForOverflow();
openHeight = controllerHeight; // Prevents checkForOverflow bug in which loaded gui appearance
// settings are not respected by presence of scrollbar.
if (!explicitOpenHeight) {
openHeight = controllerHeight;
}
return controllerObject; return controllerObject;
@ -407,15 +414,16 @@ var GUI = function() {
checkForOverflow(); checkForOverflow();
} }
// Load saved appearance:
if (GUI.guiIndex < GUI.savedAppearanceVars.length) { if (GUI.guiIndex < GUI.savedAppearanceVars.length) {
width = parseInt(GUI.savedAppearanceVars[GUI.guiIndex][1]); width = parseInt(GUI.savedAppearanceVars[GUI.guiIndex][1]);
_this.domElement.style.width = width+"px"; _this.domElement.style.width = width+"px";
openHeight = parseInt(GUI.savedAppearanceVars[GUI.guiIndex][2]); openHeight = parseInt(GUI.savedAppearanceVars[GUI.guiIndex][2]);
explicitOpenHeight = true;
if (eval(GUI.savedAppearanceVars[GUI.guiIndex][0]) == true) { if (eval(GUI.savedAppearanceVars[GUI.guiIndex][0]) == true) {
// TODO: weirdness on open ...
this.show(); this.show();
} }