From e8d4f2c1db2a85f455cf125cba69e5224f8fc15d Mon Sep 17 00:00:00 2001 From: fay Date: Fri, 5 Jun 2020 14:50:10 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20IEswitche?= =?UTF-8?q?r=E5=BC=B9=E7=AA=97=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../finebi/plugin/web/plugin.screen_adaptive.js | 17 ++++++++++++++--- .../com/finebi/plugin/web/scripts/entry.js | 17 ++++++++++++++--- 2 files changed, 28 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 5b8d485..53dfe9d 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 @@ -28,7 +28,8 @@ var originalRender = BI.Widget._renderEngine; var injectSearchSearchStop = BI.Searcher.prototype._stopSearch; var injectTooltipsShow = BI.TooltipsController.prototype.show; - var injectSwitcherPopup = BI.Switcher.prototype.adjustView; + var injectSwitcherPopup = BI.Switcher.prototype.populate; + var injectSwitcheradjustView = BI.Switcher.prototype.adjustView; var injectCreate = BI.createWidget; var callback = function () {}; @@ -364,7 +365,7 @@ } // switcher - BI.Switcher.prototype.adjustView = function () { + BI.Switcher.prototype.populate = function () { injectSwitcherPopup.call(this, arguments); if (this.popupView) { this.popupView.element[0].parentElement.style.left = parseInt(this.popupView.element[0].parentElement.style.left) * scale + "px"; @@ -373,6 +374,15 @@ this.popupView.element[0].parentElement.style.transformOrigin = "left top"; } } + BI.Switcher.prototype.adjustView = function () { + injectSwitcheradjustView.call(this, arguments); + if (this.popupView) { + this.popupView.element[0].parentElement.style.left = parseInt(this.popupView.element[0].parentElement.style.left) * scale + "px"; + this.popupView.element[0].parentElement.style.top = parseInt(this.popupView.element[0].parentElement.style.top) * scale + "px"; + this.popupView.element[0].parentElement.style.transform = "scale(" + scale + ")"; + this.popupView.element[0].parentElement.style.transformOrigin = "left top"; + } + } } BI.createWidget = function () { @@ -480,7 +490,8 @@ BI.Widget.registerRenderEngine(originalRender); callback = function () {} - BI.Switcher.prototype.adjustView = injectSwitcherPopup; + BI.Switcher.prototype.populate = injectSwitcherPopup; + BI.Switcher.prototype.adjustView = injectSwitcheradjustView; BI.TooltipsController.prototype.show = injectTooltipsShow; document.body.onmousedown = null; 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 5b8d485..53dfe9d 100644 --- a/src/main/resources/com/finebi/plugin/web/scripts/entry.js +++ b/src/main/resources/com/finebi/plugin/web/scripts/entry.js @@ -28,7 +28,8 @@ var originalRender = BI.Widget._renderEngine; var injectSearchSearchStop = BI.Searcher.prototype._stopSearch; var injectTooltipsShow = BI.TooltipsController.prototype.show; - var injectSwitcherPopup = BI.Switcher.prototype.adjustView; + var injectSwitcherPopup = BI.Switcher.prototype.populate; + var injectSwitcheradjustView = BI.Switcher.prototype.adjustView; var injectCreate = BI.createWidget; var callback = function () {}; @@ -364,7 +365,7 @@ } // switcher - BI.Switcher.prototype.adjustView = function () { + BI.Switcher.prototype.populate = function () { injectSwitcherPopup.call(this, arguments); if (this.popupView) { this.popupView.element[0].parentElement.style.left = parseInt(this.popupView.element[0].parentElement.style.left) * scale + "px"; @@ -373,6 +374,15 @@ this.popupView.element[0].parentElement.style.transformOrigin = "left top"; } } + BI.Switcher.prototype.adjustView = function () { + injectSwitcheradjustView.call(this, arguments); + if (this.popupView) { + this.popupView.element[0].parentElement.style.left = parseInt(this.popupView.element[0].parentElement.style.left) * scale + "px"; + this.popupView.element[0].parentElement.style.top = parseInt(this.popupView.element[0].parentElement.style.top) * scale + "px"; + this.popupView.element[0].parentElement.style.transform = "scale(" + scale + ")"; + this.popupView.element[0].parentElement.style.transformOrigin = "left top"; + } + } } BI.createWidget = function () { @@ -480,7 +490,8 @@ BI.Widget.registerRenderEngine(originalRender); callback = function () {} - BI.Switcher.prototype.adjustView = injectSwitcherPopup; + BI.Switcher.prototype.populate = injectSwitcherPopup; + BI.Switcher.prototype.adjustView = injectSwitcheradjustView; BI.TooltipsController.prototype.show = injectTooltipsShow; document.body.onmousedown = null; From 746661ccd53120199943bc57f90a184b7802f4e0 Mon Sep 17 00:00:00 2001 From: fay Date: Fri, 5 Jun 2020 15:13:01 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20IE?= =?UTF-8?q?=E5=BC=B9=E5=87=BA=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/finebi/plugin/web/plugin.screen_adaptive.js | 12 ++++++------ .../resources/com/finebi/plugin/web/scripts/entry.js | 12 ++++++------ 2 files changed, 12 insertions(+), 12 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 53dfe9d..8fc9f0f 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 @@ -29,7 +29,7 @@ var injectSearchSearchStop = BI.Searcher.prototype._stopSearch; var injectTooltipsShow = BI.TooltipsController.prototype.show; var injectSwitcherPopup = BI.Switcher.prototype.populate; - var injectSwitcheradjustView = BI.Switcher.prototype.adjustView; + var injectSwitcherAdjustView = BI.Switcher.prototype.adjustView; var injectCreate = BI.createWidget; var callback = function () {}; @@ -357,7 +357,7 @@ } BI.Searcher.prototype._stopSearch = function () { - injectSearchSearchStop.call(this, arguments); + injectSearchSearchStop.apply(this, arguments); if (this.popupView && this.popupView.element[0].parentElement) { this.popupView.element[0].parentElement.style.transform = ""; this.popupView.element[0].parentElement.style.transformOrigin = ""; @@ -365,8 +365,8 @@ } // switcher - BI.Switcher.prototype.populate = function () { - injectSwitcherPopup.call(this, arguments); + BI.Switcher.prototype.populate = function (items) { + injectSwitcherPopup.apply(this, arguments); if (this.popupView) { this.popupView.element[0].parentElement.style.left = parseInt(this.popupView.element[0].parentElement.style.left) * scale + "px"; this.popupView.element[0].parentElement.style.top = parseInt(this.popupView.element[0].parentElement.style.top) * scale + "px"; @@ -375,7 +375,7 @@ } } BI.Switcher.prototype.adjustView = function () { - injectSwitcheradjustView.call(this, arguments); + injectSwitcherAdjustView.apply(this, arguments); if (this.popupView) { this.popupView.element[0].parentElement.style.left = parseInt(this.popupView.element[0].parentElement.style.left) * scale + "px"; this.popupView.element[0].parentElement.style.top = parseInt(this.popupView.element[0].parentElement.style.top) * scale + "px"; @@ -491,7 +491,7 @@ callback = function () {} BI.Switcher.prototype.populate = injectSwitcherPopup; - BI.Switcher.prototype.adjustView = injectSwitcheradjustView; + BI.Switcher.prototype.adjustView = injectSwitcherAdjustView; BI.TooltipsController.prototype.show = injectTooltipsShow; document.body.onmousedown = null; 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 53dfe9d..8fc9f0f 100644 --- a/src/main/resources/com/finebi/plugin/web/scripts/entry.js +++ b/src/main/resources/com/finebi/plugin/web/scripts/entry.js @@ -29,7 +29,7 @@ var injectSearchSearchStop = BI.Searcher.prototype._stopSearch; var injectTooltipsShow = BI.TooltipsController.prototype.show; var injectSwitcherPopup = BI.Switcher.prototype.populate; - var injectSwitcheradjustView = BI.Switcher.prototype.adjustView; + var injectSwitcherAdjustView = BI.Switcher.prototype.adjustView; var injectCreate = BI.createWidget; var callback = function () {}; @@ -357,7 +357,7 @@ } BI.Searcher.prototype._stopSearch = function () { - injectSearchSearchStop.call(this, arguments); + injectSearchSearchStop.apply(this, arguments); if (this.popupView && this.popupView.element[0].parentElement) { this.popupView.element[0].parentElement.style.transform = ""; this.popupView.element[0].parentElement.style.transformOrigin = ""; @@ -365,8 +365,8 @@ } // switcher - BI.Switcher.prototype.populate = function () { - injectSwitcherPopup.call(this, arguments); + BI.Switcher.prototype.populate = function (items) { + injectSwitcherPopup.apply(this, arguments); if (this.popupView) { this.popupView.element[0].parentElement.style.left = parseInt(this.popupView.element[0].parentElement.style.left) * scale + "px"; this.popupView.element[0].parentElement.style.top = parseInt(this.popupView.element[0].parentElement.style.top) * scale + "px"; @@ -375,7 +375,7 @@ } } BI.Switcher.prototype.adjustView = function () { - injectSwitcheradjustView.call(this, arguments); + injectSwitcherAdjustView.apply(this, arguments); if (this.popupView) { this.popupView.element[0].parentElement.style.left = parseInt(this.popupView.element[0].parentElement.style.left) * scale + "px"; this.popupView.element[0].parentElement.style.top = parseInt(this.popupView.element[0].parentElement.style.top) * scale + "px"; @@ -491,7 +491,7 @@ callback = function () {} BI.Switcher.prototype.populate = injectSwitcherPopup; - BI.Switcher.prototype.adjustView = injectSwitcheradjustView; + BI.Switcher.prototype.adjustView = injectSwitcherAdjustView; BI.TooltipsController.prototype.show = injectTooltipsShow; document.body.onmousedown = null; From b7262aa3a42e46565a084d71862fe1156f538c81 Mon Sep 17 00:00:00 2001 From: fay Date: Fri, 5 Jun 2020 15:24:14 +0800 Subject: [PATCH 3/3] update --- .../finebi/plugin/web/plugin.screen_adaptive.js | 15 +++++++++------ .../com/finebi/plugin/web/scripts/entry.js | 15 +++++++++------ 2 files changed, 18 insertions(+), 12 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 8fc9f0f..555eefa 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 @@ -367,12 +367,15 @@ // switcher BI.Switcher.prototype.populate = function (items) { injectSwitcherPopup.apply(this, arguments); - if (this.popupView) { - this.popupView.element[0].parentElement.style.left = parseInt(this.popupView.element[0].parentElement.style.left) * scale + "px"; - this.popupView.element[0].parentElement.style.top = parseInt(this.popupView.element[0].parentElement.style.top) * scale + "px"; - this.popupView.element[0].parentElement.style.transform = "scale(" + scale + ")"; - this.popupView.element[0].parentElement.style.transformOrigin = "left top"; - } + var self = this; + BI.defer(function () { + if (self.popupView) { + self.popupView.element[0].parentElement.style.left = parseInt(self.popupView.element[0].parentElement.style.left) * scale + "px"; + self.popupView.element[0].parentElement.style.top = parseInt(self.popupView.element[0].parentElement.style.top) * scale + "px"; + self.popupView.element[0].parentElement.style.transform = "scale(" + scale + ")"; + self.popupView.element[0].parentElement.style.transformOrigin = "left top"; + } + }) } BI.Switcher.prototype.adjustView = function () { injectSwitcherAdjustView.apply(this, arguments); 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 8fc9f0f..555eefa 100644 --- a/src/main/resources/com/finebi/plugin/web/scripts/entry.js +++ b/src/main/resources/com/finebi/plugin/web/scripts/entry.js @@ -367,12 +367,15 @@ // switcher BI.Switcher.prototype.populate = function (items) { injectSwitcherPopup.apply(this, arguments); - if (this.popupView) { - this.popupView.element[0].parentElement.style.left = parseInt(this.popupView.element[0].parentElement.style.left) * scale + "px"; - this.popupView.element[0].parentElement.style.top = parseInt(this.popupView.element[0].parentElement.style.top) * scale + "px"; - this.popupView.element[0].parentElement.style.transform = "scale(" + scale + ")"; - this.popupView.element[0].parentElement.style.transformOrigin = "left top"; - } + var self = this; + BI.defer(function () { + if (self.popupView) { + self.popupView.element[0].parentElement.style.left = parseInt(self.popupView.element[0].parentElement.style.left) * scale + "px"; + self.popupView.element[0].parentElement.style.top = parseInt(self.popupView.element[0].parentElement.style.top) * scale + "px"; + self.popupView.element[0].parentElement.style.transform = "scale(" + scale + ")"; + self.popupView.element[0].parentElement.style.transformOrigin = "left top"; + } + }) } BI.Switcher.prototype.adjustView = function () { injectSwitcherAdjustView.apply(this, arguments);