mirror of
https://github.com/dataarts/dat.gui.git
synced 2024-12-12 04:08:27 +00:00
remove hardcoded assumption that dat.gui work as fixed position #build
This commit is contained in:
parent
3faf42f502
commit
fe5bb21f59
@ -2015,16 +2015,15 @@ Common.extend(GUI.prototype,
|
|||||||
onResize: function onResize() {
|
onResize: function onResize() {
|
||||||
var root = this.getRoot();
|
var root = this.getRoot();
|
||||||
if (root.scrollable) {
|
if (root.scrollable) {
|
||||||
var top = dom.getOffset(root.__ul).top;
|
|
||||||
var h = 0;
|
var h = 0;
|
||||||
Common.each(root.__ul.childNodes, function (node) {
|
Common.each(root.__ul.childNodes, function (node) {
|
||||||
if (!(root.autoPlace && node === root.__save_row)) {
|
if (!(root.autoPlace && node === root.__save_row)) {
|
||||||
h += dom.getHeight(node);
|
h += dom.getHeight(node);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (window.innerHeight - top - CLOSE_BUTTON_HEIGHT < h) {
|
if (root.domElement.clientHeight - CLOSE_BUTTON_HEIGHT < h) {
|
||||||
dom.addClass(root.domElement, GUI.CLASS_TOO_TALL);
|
dom.addClass(root.domElement, GUI.CLASS_TOO_TALL);
|
||||||
root.__ul.style.height = window.innerHeight - top - CLOSE_BUTTON_HEIGHT + 'px';
|
root.__ul.style.height = root.domElement.clientHeight - CLOSE_BUTTON_HEIGHT + 'px';
|
||||||
} else {
|
} else {
|
||||||
dom.removeClass(root.domElement, GUI.CLASS_TOO_TALL);
|
dom.removeClass(root.domElement, GUI.CLASS_TOO_TALL);
|
||||||
root.__ul.style.height = 'auto';
|
root.__ul.style.height = 'auto';
|
||||||
|
File diff suppressed because one or more lines are too long
2
build/dat.gui.min.js
vendored
2
build/dat.gui.min.js
vendored
File diff suppressed because one or more lines are too long
@ -2009,16 +2009,15 @@ Common.extend(GUI.prototype,
|
|||||||
onResize: function onResize() {
|
onResize: function onResize() {
|
||||||
var root = this.getRoot();
|
var root = this.getRoot();
|
||||||
if (root.scrollable) {
|
if (root.scrollable) {
|
||||||
var top = dom.getOffset(root.__ul).top;
|
|
||||||
var h = 0;
|
var h = 0;
|
||||||
Common.each(root.__ul.childNodes, function (node) {
|
Common.each(root.__ul.childNodes, function (node) {
|
||||||
if (!(root.autoPlace && node === root.__save_row)) {
|
if (!(root.autoPlace && node === root.__save_row)) {
|
||||||
h += dom.getHeight(node);
|
h += dom.getHeight(node);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (window.innerHeight - top - CLOSE_BUTTON_HEIGHT < h) {
|
if (root.domElement.clientHeight - CLOSE_BUTTON_HEIGHT < h) {
|
||||||
dom.addClass(root.domElement, GUI.CLASS_TOO_TALL);
|
dom.addClass(root.domElement, GUI.CLASS_TOO_TALL);
|
||||||
root.__ul.style.height = window.innerHeight - top - CLOSE_BUTTON_HEIGHT + 'px';
|
root.__ul.style.height = root.domElement.clientHeight - CLOSE_BUTTON_HEIGHT + 'px';
|
||||||
} else {
|
} else {
|
||||||
dom.removeClass(root.domElement, GUI.CLASS_TOO_TALL);
|
dom.removeClass(root.domElement, GUI.CLASS_TOO_TALL);
|
||||||
root.__ul.style.height = 'auto';
|
root.__ul.style.height = 'auto';
|
||||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user