Browse Source

BI-66270 fix: 傻叉IE

persist/10.0
fay 5 years ago
parent
commit
72b886adfa
  1. 38
      src/main/resources/com/finebi/plugin/web/plugin.screen_adaptive.js
  2. 38
      src/main/resources/com/finebi/plugin/web/scripts/entry.js

38
src/main/resources/com/finebi/plugin/web/plugin.screen_adaptive.js

@ -26,9 +26,7 @@
var injectBubblesShow = null; var injectBubblesShow = null;
var adjustHeight = BI.Combo.prototype.adjustHeight; var adjustHeight = BI.Combo.prototype.adjustHeight;
var originalRender = BI.Widget._renderEngine; var originalRender = BI.Widget._renderEngine;
var injectSearch = BI.Searcher.prototype._search; var injectSearchSearchStop = BI.Searcher.prototype._stopSearch;
var injectSearchSetValue = BI.Searcher.prototype.setValue;
var injectSearchAdjustView = BI.Searcher.prototype._assertPopupView;
var injectTooltipsShow = BI.TooltipsController.prototype.show; var injectTooltipsShow = BI.TooltipsController.prototype.show;
var injectSwitcherPopup = BI.Switcher.prototype.adjustView; var injectSwitcherPopup = BI.Switcher.prototype.adjustView;
@ -47,15 +45,7 @@
this.popupView.populate(find, match, keyword); this.popupView.populate(find, match, keyword);
o.isAutoSync && o.adapter && o.adapter.getValue && this.popupView.setValue(o.adapter.getValue()); o.isAutoSync && o.adapter && o.adapter.getValue && this.popupView.setValue(o.adapter.getValue());
self.fireEvent(BI.Searcher.EVENT_SEARCHING); self.fireEvent(BI.Searcher.EVENT_SEARCHING);
callback && callback.call(self); callback && callback.call(self, true);
if (self.popupView) {
BI.defer(function () {
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";
})
}
return; return;
} }
this.popupView.loading && this.popupView.loading(); this.popupView.loading && this.popupView.loading();
@ -350,25 +340,26 @@
} }
// Searcher // Searcher
callback = function () { callback = function (flag) {
var self = this; var self = this;
BI.defer(function () { BI.defer(function () {
if (self.popupView && self.popupView.element[0].parentElement) { if (self.popupView && self.popupView.element[0].parentElement) {
self.popupView.element[0].parentElement.style.left = parseInt(self.popupView.element[0].parentElement.style.left) * scale + "px"; var skip = BI.isNotEmptyString(self.popupView.element[0].parentElement.style.transformOrigin) && flag;
self.popupView.element[0].parentElement.style.top = parseInt(self.popupView.element[0].parentElement.style.top) * scale + "px"; if (!skip) {
self.popupView.element[0].parentElement.style.transform = "scale(" + scale + ")"; self.popupView.element[0].parentElement.style.left = parseInt(self.popupView.element[0].parentElement.style.left) * scale + "px";
self.popupView.element[0].parentElement.style.transformOrigin = "left top"; 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.Searcher.prototype.setValue = function () { BI.Searcher.prototype._stopSearch = function () {
injectSearchSetValue.call(this, arguments); injectSearchSearchStop.call(this, arguments);
if (this.popupView && this.popupView.element[0].parentElement) { if (this.popupView && this.popupView.element[0].parentElement) {
this.popupView.element[0].parentElement.style.left = parseInt(this.popupView.element[0].parentElement.style.left) * scale + "px"; this.popupView.element[0].parentElement.style.transform = "";
this.popupView.element[0].parentElement.style.top = parseInt(this.popupView.element[0].parentElement.style.top) * scale + "px"; this.popupView.element[0].parentElement.style.transformOrigin = "";
this.popupView.element[0].parentElement.style.transform = "scale(" + scale + ")";
this.popupView.element[0].parentElement.style.transformOrigin = "left top";
} }
} }
@ -489,7 +480,6 @@
BI.Widget.registerRenderEngine(originalRender); BI.Widget.registerRenderEngine(originalRender);
callback = function () {} callback = function () {}
BI.Searcher.prototype.setValue = injectSearchSetValue;
BI.Switcher.prototype.adjustView = injectSwitcherPopup; BI.Switcher.prototype.adjustView = injectSwitcherPopup;
BI.TooltipsController.prototype.show = injectTooltipsShow; BI.TooltipsController.prototype.show = injectTooltipsShow;

38
src/main/resources/com/finebi/plugin/web/scripts/entry.js

@ -26,9 +26,7 @@
var injectBubblesShow = null; var injectBubblesShow = null;
var adjustHeight = BI.Combo.prototype.adjustHeight; var adjustHeight = BI.Combo.prototype.adjustHeight;
var originalRender = BI.Widget._renderEngine; var originalRender = BI.Widget._renderEngine;
var injectSearch = BI.Searcher.prototype._search; var injectSearchSearchStop = BI.Searcher.prototype._stopSearch;
var injectSearchSetValue = BI.Searcher.prototype.setValue;
var injectSearchAdjustView = BI.Searcher.prototype._assertPopupView;
var injectTooltipsShow = BI.TooltipsController.prototype.show; var injectTooltipsShow = BI.TooltipsController.prototype.show;
var injectSwitcherPopup = BI.Switcher.prototype.adjustView; var injectSwitcherPopup = BI.Switcher.prototype.adjustView;
@ -47,15 +45,7 @@
this.popupView.populate(find, match, keyword); this.popupView.populate(find, match, keyword);
o.isAutoSync && o.adapter && o.adapter.getValue && this.popupView.setValue(o.adapter.getValue()); o.isAutoSync && o.adapter && o.adapter.getValue && this.popupView.setValue(o.adapter.getValue());
self.fireEvent(BI.Searcher.EVENT_SEARCHING); self.fireEvent(BI.Searcher.EVENT_SEARCHING);
callback && callback.call(self); callback && callback.call(self, true);
if (self.popupView) {
BI.defer(function () {
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";
})
}
return; return;
} }
this.popupView.loading && this.popupView.loading(); this.popupView.loading && this.popupView.loading();
@ -350,25 +340,26 @@
} }
// Searcher // Searcher
callback = function () { callback = function (flag) {
var self = this; var self = this;
BI.defer(function () { BI.defer(function () {
if (self.popupView && self.popupView.element[0].parentElement) { if (self.popupView && self.popupView.element[0].parentElement) {
self.popupView.element[0].parentElement.style.left = parseInt(self.popupView.element[0].parentElement.style.left) * scale + "px"; var skip = BI.isNotEmptyString(self.popupView.element[0].parentElement.style.transformOrigin) && flag;
self.popupView.element[0].parentElement.style.top = parseInt(self.popupView.element[0].parentElement.style.top) * scale + "px"; if (!skip) {
self.popupView.element[0].parentElement.style.transform = "scale(" + scale + ")"; self.popupView.element[0].parentElement.style.left = parseInt(self.popupView.element[0].parentElement.style.left) * scale + "px";
self.popupView.element[0].parentElement.style.transformOrigin = "left top"; 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.Searcher.prototype.setValue = function () { BI.Searcher.prototype._stopSearch = function () {
injectSearchSetValue.call(this, arguments); injectSearchSearchStop.call(this, arguments);
if (this.popupView && this.popupView.element[0].parentElement) { if (this.popupView && this.popupView.element[0].parentElement) {
this.popupView.element[0].parentElement.style.left = parseInt(this.popupView.element[0].parentElement.style.left) * scale + "px"; this.popupView.element[0].parentElement.style.transform = "";
this.popupView.element[0].parentElement.style.top = parseInt(this.popupView.element[0].parentElement.style.top) * scale + "px"; this.popupView.element[0].parentElement.style.transformOrigin = "";
this.popupView.element[0].parentElement.style.transform = "scale(" + scale + ")";
this.popupView.element[0].parentElement.style.transformOrigin = "left top";
} }
} }
@ -489,7 +480,6 @@
BI.Widget.registerRenderEngine(originalRender); BI.Widget.registerRenderEngine(originalRender);
callback = function () {} callback = function () {}
BI.Searcher.prototype.setValue = injectSearchSetValue;
BI.Switcher.prototype.adjustView = injectSwitcherPopup; BI.Switcher.prototype.adjustView = injectSwitcherPopup;
BI.TooltipsController.prototype.show = injectTooltipsShow; BI.TooltipsController.prototype.show = injectTooltipsShow;

Loading…
Cancel
Save