From 1da04df391dd51bba3bedc10db00366640f91473 Mon Sep 17 00:00:00 2001 From: Fay Date: Wed, 24 Jul 2019 10:21:07 +0800 Subject: [PATCH] =?UTF-8?q?CHART-9916=20fix=EF=BC=9Atop=E6=81=A2=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/finebi/plugin/web/plugin.screen_adaptive.js | 6 +++--- src/main/resources/com/finebi/plugin/web/scripts/entry.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/resources/com/finebi/plugin/web/plugin.screen_adaptive.js b/src/main/resources/com/finebi/plugin/web/plugin.screen_adaptive.js index 0f04026..cb7596f 100644 --- a/src/main/resources/com/finebi/plugin/web/plugin.screen_adaptive.js +++ b/src/main/resources/com/finebi/plugin/web/plugin.screen_adaptive.js @@ -34,11 +34,11 @@ if (bounds.height * bounds.scale < html.clientHeight) { transformY = (html.clientHeight - bounds.height * bounds.scale) / 2; - document.body.style.top = transformY + "px"; html.style.overflowY = "hidden"; } else { transformY = 0; } + document.body.style.top = transformY + "px"; window.scale = window.devicePixelRatio * scale; @@ -183,11 +183,11 @@ removeListener(selectHandler); } - function selectHandler () { + var selectHandler = BI.debounce(function () { selected && prepareEnv(); selected ? transformScale() : removeScale(); !selected && restoreEnv(); - } + }, 30); function updateScale () { if (html.getBoundingClientRect().width !== document.body.getBoundingClientRect().width) { diff --git a/src/main/resources/com/finebi/plugin/web/scripts/entry.js b/src/main/resources/com/finebi/plugin/web/scripts/entry.js index 0f04026..cb7596f 100644 --- a/src/main/resources/com/finebi/plugin/web/scripts/entry.js +++ b/src/main/resources/com/finebi/plugin/web/scripts/entry.js @@ -34,11 +34,11 @@ if (bounds.height * bounds.scale < html.clientHeight) { transformY = (html.clientHeight - bounds.height * bounds.scale) / 2; - document.body.style.top = transformY + "px"; html.style.overflowY = "hidden"; } else { transformY = 0; } + document.body.style.top = transformY + "px"; window.scale = window.devicePixelRatio * scale; @@ -183,11 +183,11 @@ removeListener(selectHandler); } - function selectHandler () { + var selectHandler = BI.debounce(function () { selected && prepareEnv(); selected ? transformScale() : removeScale(); !selected && restoreEnv(); - } + }, 30); function updateScale () { if (html.getBoundingClientRect().width !== document.body.getBoundingClientRect().width) {