gui styling adaptation for scrollbars width

This commit is contained in:
Jono Brandel 2011-02-10 12:16:51 -08:00
parent 70ed6c1e32
commit 765ade71e9

22
gui.js
View File

@ -138,22 +138,14 @@ var GUI = function() {
_this.toggle();
// Clears lingering slider column
_this.domElement.style.width = (width+1)+'px';
setTimeout(function() {
_this.domElement.style.width = width+'px';
}, 1);
}
if (togglePressed && toggleDragged) {
if (dragDisplacementX == 0) {
// Clears lingering slider column
_this.domElement.style.width = (width+1)+'px';
setTimeout(function() {
_this.domElement.style.width = width+'px';
}, 1);
adaptToScrollbar()
}
@ -420,6 +412,8 @@ var GUI = function() {
curControllerContainerHeight += (resizeTo - curControllerContainerHeight)*0.6;
if (Math.abs(curControllerContainerHeight-resizeTo) < 1) {
curControllerContainerHeight = resizeTo;
adaptToScrollbar();
} else {
resizeTimeout = setTimeout(beginResize, 1000/30);
}
@ -427,6 +421,14 @@ var GUI = function() {
checkForOverflow();
}
var adaptToScrollbar = function() {
// Clears lingering slider column
_this.domElement.style.width = (width+1)+'px';
setTimeout(function() {
_this.domElement.style.width = width+'px';
}, 1);
};
// Load saved appearance:
if (GUI.guiIndex < GUI.savedAppearanceVars.length) {