mirror of
https://github.com/dataarts/dat.gui.git
synced 2024-12-12 04:08:27 +00:00
Working on string controller
This commit is contained in:
parent
5bde5f79a1
commit
7501ba9839
@ -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);
|
||||||
|
@ -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
14
gui.js
@ -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;
|
||||||
|
|
||||||
@ -406,6 +413,8 @@ var GUI = function() {
|
|||||||
controllerContainer.style.height = Math.round(curControllerContainerHeight)+'px';
|
controllerContainer.style.height = Math.round(curControllerContainerHeight)+'px';
|
||||||
checkForOverflow();
|
checkForOverflow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Load saved appearance:
|
||||||
|
|
||||||
if (GUI.guiIndex < GUI.savedAppearanceVars.length) {
|
if (GUI.guiIndex < GUI.savedAppearanceVars.length) {
|
||||||
|
|
||||||
@ -413,9 +422,8 @@ var GUI = function() {
|
|||||||
_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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user