From 4dd9c866b7d5f9931c0c19cdb4a9b4a0945c45a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20Trz=C4=99siok?= Date: Fri, 25 May 2018 09:10:13 +0200 Subject: [PATCH] remove hardcoded assumption that dat.gui work as fixed position --- src/dat/gui/GUI.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/dat/gui/GUI.js b/src/dat/gui/GUI.js index a0e6f04..2b646dd 100644 --- a/src/dat/gui/GUI.js +++ b/src/dat/gui/GUI.js @@ -688,7 +688,6 @@ common.extend( // we debounce this function to prevent performance issues when rotating on tablet/mobile const root = this.getRoot(); if (root.scrollable) { - const top = dom.getOffset(root.__ul).top; let h = 0; common.each(root.__ul.childNodes, function(node) { @@ -697,9 +696,9 @@ common.extend( } }); - if (window.innerHeight - top - CLOSE_BUTTON_HEIGHT < h) { + if (root.domElement.clientHeight - CLOSE_BUTTON_HEIGHT < h) { 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 { dom.removeClass(root.domElement, GUI.CLASS_TOO_TALL); root.__ul.style.height = 'auto';