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();
}, false);
// TODO: getting messed up on ctrl a
input.addEventListener('keyup', function() {
_this.setValue(input.value);
}, false);

View File

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

14
gui.js
View File

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