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) {