mirror of
https://github.com/dataarts/dat.gui.git
synced 2024-12-12 04:08:27 +00:00
gui styling adaptation for scrollbars width
This commit is contained in:
parent
70ed6c1e32
commit
765ade71e9
22
gui.js
22
gui.js
@ -138,22 +138,14 @@ var GUI = function() {
|
|||||||
|
|
||||||
_this.toggle();
|
_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 (togglePressed && toggleDragged) {
|
||||||
|
|
||||||
if (dragDisplacementX == 0) {
|
if (dragDisplacementX == 0) {
|
||||||
|
|
||||||
// Clears lingering slider column
|
adaptToScrollbar()
|
||||||
_this.domElement.style.width = (width+1)+'px';
|
|
||||||
setTimeout(function() {
|
|
||||||
_this.domElement.style.width = width+'px';
|
|
||||||
}, 1);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -420,6 +412,8 @@ var GUI = function() {
|
|||||||
curControllerContainerHeight += (resizeTo - curControllerContainerHeight)*0.6;
|
curControllerContainerHeight += (resizeTo - curControllerContainerHeight)*0.6;
|
||||||
if (Math.abs(curControllerContainerHeight-resizeTo) < 1) {
|
if (Math.abs(curControllerContainerHeight-resizeTo) < 1) {
|
||||||
curControllerContainerHeight = resizeTo;
|
curControllerContainerHeight = resizeTo;
|
||||||
|
adaptToScrollbar();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
resizeTimeout = setTimeout(beginResize, 1000/30);
|
resizeTimeout = setTimeout(beginResize, 1000/30);
|
||||||
}
|
}
|
||||||
@ -427,6 +421,14 @@ var GUI = function() {
|
|||||||
checkForOverflow();
|
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:
|
// Load saved appearance:
|
||||||
|
|
||||||
if (GUI.guiIndex < GUI.savedAppearanceVars.length) {
|
if (GUI.guiIndex < GUI.savedAppearanceVars.length) {
|
||||||
|
Loading…
Reference in New Issue
Block a user