From 9d50ad12ecc790456a2c4895bd8ecd5dfe909c6a Mon Sep 17 00:00:00 2001 From: fay Date: Wed, 11 Mar 2020 14:27:45 +0800 Subject: [PATCH 1/2] =?UTF-8?q?BI-61373=20fix:=20=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E9=80=A0=E6=88=90=E6=A8=A1=E6=9D=BF=E4=BD=8D=E7=BD=AE=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= 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 fc6f736..3f75fc2 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 @@ -203,7 +203,7 @@ } offsetLeft -= elm.scrollLeft || 0; offsetTop -= elm.scrollTop || 0; - elm = elm.parentNode; + elm = elm.offsetParent; } while( elm ); } win = getWindow( doc ); @@ -221,8 +221,8 @@ adjustHeight.call(this, e); if (this.popupView) { if (!checkInPopupView(this.popupView.element[0])) { - this.popupView.element[0].style.left = parseInt(this.popupView.element[0].style.left) * scale + "px"; - this.popupView.element[0].style.top = parseInt(this.popupView.element[0].style.top) * scale + transformY + "px"; + this.popupView.element[0].style.left = (parseInt(this.popupView.element[0].style.left) * scale - document.body.scrollLeft) + "px"; + this.popupView.element[0].style.top = (parseInt(this.popupView.element[0].style.top) * scale + transformY - document.body.scrollTop) + "px"; } else { } 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 fc6f736..3f75fc2 100644 --- a/src/main/resources/com/finebi/plugin/web/scripts/entry.js +++ b/src/main/resources/com/finebi/plugin/web/scripts/entry.js @@ -203,7 +203,7 @@ } offsetLeft -= elm.scrollLeft || 0; offsetTop -= elm.scrollTop || 0; - elm = elm.parentNode; + elm = elm.offsetParent; } while( elm ); } win = getWindow( doc ); @@ -221,8 +221,8 @@ adjustHeight.call(this, e); if (this.popupView) { if (!checkInPopupView(this.popupView.element[0])) { - this.popupView.element[0].style.left = parseInt(this.popupView.element[0].style.left) * scale + "px"; - this.popupView.element[0].style.top = parseInt(this.popupView.element[0].style.top) * scale + transformY + "px"; + this.popupView.element[0].style.left = (parseInt(this.popupView.element[0].style.left) * scale - document.body.scrollLeft) + "px"; + this.popupView.element[0].style.top = (parseInt(this.popupView.element[0].style.top) * scale + transformY - document.body.scrollTop) + "px"; } else { } From db98df02f1e9ba5b5a2ea2c577c7ae8fab103837 Mon Sep 17 00:00:00 2001 From: fay Date: Wed, 11 Mar 2020 14:33:00 +0800 Subject: [PATCH 2/2] fix IE --- .../com/finebi/plugin/web/plugin.screen_adaptive.js | 8 ++++---- src/main/resources/com/finebi/plugin/web/scripts/entry.js | 8 ++++---- 2 files changed, 8 insertions(+), 8 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 3f75fc2..09987e2 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 @@ -233,16 +233,16 @@ BI.Tooltips.show = function (e, name, text, level, context, opt) { injectToolTipShow.call(this, e, name, text, level, context, opt); var tooltip = this.get(name); - tooltip.element[0].style.left = parseInt(tooltip.element[0].style.left) * scale + "px"; - tooltip.element[0].style.top = parseInt(tooltip.element[0].style.top) * scale + transformY + "px"; + tooltip.element[0].style.left = parseInt(tooltip.element[0].style.left) * scale - document.body.scrollLeft + "px"; + tooltip.element[0].style.top = parseInt(tooltip.element[0].style.top) * scale + transformY - document.body.scrollTop + "px"; tooltip.element[0].style.transform = "scale(" + scale+ ")"; tooltip.element[0].style.transformOrigin = "top left"; } BI.Bubbles.show = function (name, text, context, opt) { injectBubblesShow.call(this, name, text, context, opt); var tooltip = this.get(name); - tooltip.element[0].style.left = parseInt(tooltip.element[0].style.left) * scale + "px"; - tooltip.element[0].style.top = parseInt(tooltip.element[0].style.top) * scale + transformY + "px"; + tooltip.element[0].style.left = parseInt(tooltip.element[0].style.left) * scale - document.body.scrollLeft + "px"; + tooltip.element[0].style.top = parseInt(tooltip.element[0].style.top) * scale + transformY - document.body.scrollTop + "px"; tooltip.element[0].style.transform = "scale(" + scale+ ")"; tooltip.element[0].style.transformOrigin = "top left"; } 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 3f75fc2..09987e2 100644 --- a/src/main/resources/com/finebi/plugin/web/scripts/entry.js +++ b/src/main/resources/com/finebi/plugin/web/scripts/entry.js @@ -233,16 +233,16 @@ BI.Tooltips.show = function (e, name, text, level, context, opt) { injectToolTipShow.call(this, e, name, text, level, context, opt); var tooltip = this.get(name); - tooltip.element[0].style.left = parseInt(tooltip.element[0].style.left) * scale + "px"; - tooltip.element[0].style.top = parseInt(tooltip.element[0].style.top) * scale + transformY + "px"; + tooltip.element[0].style.left = parseInt(tooltip.element[0].style.left) * scale - document.body.scrollLeft + "px"; + tooltip.element[0].style.top = parseInt(tooltip.element[0].style.top) * scale + transformY - document.body.scrollTop + "px"; tooltip.element[0].style.transform = "scale(" + scale+ ")"; tooltip.element[0].style.transformOrigin = "top left"; } BI.Bubbles.show = function (name, text, context, opt) { injectBubblesShow.call(this, name, text, context, opt); var tooltip = this.get(name); - tooltip.element[0].style.left = parseInt(tooltip.element[0].style.left) * scale + "px"; - tooltip.element[0].style.top = parseInt(tooltip.element[0].style.top) * scale + transformY + "px"; + tooltip.element[0].style.left = parseInt(tooltip.element[0].style.left) * scale - document.body.scrollLeft + "px"; + tooltip.element[0].style.top = parseInt(tooltip.element[0].style.top) * scale + transformY - document.body.scrollTop + "px"; tooltip.element[0].style.transform = "scale(" + scale+ ")"; tooltip.element[0].style.transformOrigin = "top left"; }