Browse Source

update

feature/10.0
Fay 6 years ago
parent
commit
88fcc411d0
  1. 75
      src/main/resources/com/finebi/plugin/web/plugin.screen_adaptive.js
  2. 71
      src/main/resources/com/finebi/plugin/web/scripts/entry.js

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

@ -43,13 +43,14 @@
function transformScale() { function transformScale() {
var bounds = getScaleBounds(); var bounds = getScaleBounds();
scale = bounds.scale; scale = bounds.scale;
wrapper.style.position = "relative"; document.body.style.position = "relative";
wrapper.style.width = bounds.width + "px"; document.body.style.width = bounds.width + "px";
wrapper.style.height = bounds.height + "px"; document.body.style.height = bounds.height + "px";
wrapper.style.transform = "scale(" + bounds.scale+ ")"; document.body.style.transform = "scale(" + bounds.scale+ ")";
wrapper.style.transformOrigin = "top left"; document.body.style.transformOrigin = "top left";
wrapper.style["-ms-transform"] = "scale(" + bounds.scale+ ")"; document.body.style["-ms-transform"] = "scale(" + bounds.scale+ ")";
wrapper.style["-ms-transform-origin"] = "top left"; document.body.style["-ms-transform-origin"] = "top left";
document.body.style.top = transformY + "px";
html.style.overflowY = "auto"; html.style.overflowY = "auto";
html.style.backgroundColor = document.getElementsByClassName('bi-theme-dark').length === 0 ? "#2c3d59" : "#ffffff"; html.style.backgroundColor = document.getElementsByClassName('bi-theme-dark').length === 0 ? "#2c3d59" : "#ffffff";
@ -60,29 +61,29 @@
transformY = 0; transformY = 0;
} }
document.body.style.top = transformY + "px"; // document.body.style.height = (bounds.height * scale) + "px";
document.body.style.height = (bounds.height * scale) + "px"; // document.body.style.overflow = "hidden";
document.body.style.overflow = "hidden";
window.scale = window.devicePixelRatio * scale; window.scale = window.devicePixelRatio * scale;
// scaleFixed(); // scaleFixed();
} }
// 取消缩放 // 取消缩放
function removeScale() { function removeScale() {
wrapper.style.width = "100%"; document.body.style.width = "100%";
wrapper.style.height = "100%"; document.body.style.height = "100%";
wrapper.style.transform = ""; document.body.style.transform = "";
wrapper.style.transformOrigin = ""; document.body.style.transformOrigin = "";
wrapper.style["-ms-transform"] = ""; document.body.style["-ms-transform"] = "";
wrapper.style["-ms-transform-origin"] = ""; document.body.style["-ms-transform-origin"] = "";
wrapper.style.overflowY = "hidden"; document.body.style.overflowY = "hidden";
document.body.style.top = "";
html.style.backgroundColor = "#ffffff"; html.style.backgroundColor = "#ffffff";
scale = 1; scale = 1;
document.body.style.top = "0px"; // document.body.style.top = "0px";
document.body.style.width = ""; // document.body.style.width = "";
document.body.style.height = ""; // document.body.style.height = "";
document.body.style.overflowY = ""; // document.body.style.overflowY = "";
window.scale = window.devicePixelRatio / scale; window.scale = window.devicePixelRatio / scale;
// revertFixed(); // revertFixed();
@ -218,20 +219,20 @@
tooltip.element[0].style.transform = "scale(" + scale+ ")"; tooltip.element[0].style.transform = "scale(" + scale+ ")";
tooltip.element[0].style.transformOrigin = "top left"; tooltip.element[0].style.transformOrigin = "top left";
} }
jQuery.fn.outerWidth = function () { // jQuery.fn.outerWidth = function () {
var wdith = injectOuterWidth.apply(this, arguments); // var wdith = injectOuterWidth.apply(this, arguments);
if (this[0] === document.body) { // if (this[0] === document.body) {
return wdith / scale; // return wdith / scale;
} // }
return wdith; // return wdith;
} // }
jQuery.fn.outerHeight = function () { // jQuery.fn.outerHeight = function () {
var height = injectOuterHeight.apply(this, arguments); // var height = injectOuterHeight.apply(this, arguments);
if (this[0] === document.body) { // if (this[0] === document.body) {
return height / scale; // return height / scale;
} // }
return height; // return height;
} // }
// BI.DOM.getBottomPosition = function (combo, popup, extraHeight) { // BI.DOM.getBottomPosition = function (combo, popup, extraHeight) {
// var el = combo.element; // var el = combo.element;
// return { // return {
@ -256,12 +257,12 @@
jQuery.fn.__isMouseInBounds__ = injectMouseInBounds; jQuery.fn.__isMouseInBounds__ = injectMouseInBounds;
jQuery.fn.offset = injectOffset; jQuery.fn.offset = injectOffset;
jQuery.event.fix = injectEventFix; jQuery.event.fix = injectEventFix;
jQuery.fn.outerWidth = injectOuterWidth;
jQuery.fn.outerHeight = injectOuterHeight;
// jQuery.fn.bounds = injectBounds; // jQuery.fn.bounds = injectBounds;
if (BI.isIE()) { if (BI.isIE()) {
BI.Combo.prototype.adjustHeight = adjustHeight; BI.Combo.prototype.adjustHeight = adjustHeight;
BI.Tooltips.show = injectToolTipShow; BI.Tooltips.show = injectToolTipShow;
jQuery.fn.outerWidth = injectOuterWidth;
jQuery.fn.outerHeight = injectOuterHeight;
} }
document.body.onmousedown = null; document.body.onmousedown = null;

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

@ -43,13 +43,14 @@
function transformScale() { function transformScale() {
var bounds = getScaleBounds(); var bounds = getScaleBounds();
scale = bounds.scale; scale = bounds.scale;
wrapper.style.position = "relative"; document.body.style.position = "relative";
wrapper.style.width = bounds.width + "px"; document.body.style.width = bounds.width + "px";
wrapper.style.height = bounds.height + "px"; document.body.style.height = bounds.height + "px";
wrapper.style.transform = "scale(" + bounds.scale+ ")"; document.body.style.transform = "scale(" + bounds.scale+ ")";
wrapper.style.transformOrigin = "top left"; document.body.style.transformOrigin = "top left";
wrapper.style["-ms-transform"] = "scale(" + bounds.scale+ ")"; document.body.style["-ms-transform"] = "scale(" + bounds.scale+ ")";
wrapper.style["-ms-transform-origin"] = "top left"; document.body.style["-ms-transform-origin"] = "top left";
document.body.style.top = transformY + "px";
html.style.overflowY = "auto"; html.style.overflowY = "auto";
html.style.backgroundColor = document.getElementsByClassName('bi-theme-dark').length === 0 ? "#2c3d59" : "#ffffff"; html.style.backgroundColor = document.getElementsByClassName('bi-theme-dark').length === 0 ? "#2c3d59" : "#ffffff";
@ -60,29 +61,29 @@
transformY = 0; transformY = 0;
} }
document.body.style.top = transformY + "px"; // document.body.style.height = (bounds.height * scale) + "px";
document.body.style.height = (bounds.height * scale) + "px"; // document.body.style.overflow = "hidden";
document.body.style.overflow = "hidden";
window.scale = window.devicePixelRatio * scale; window.scale = window.devicePixelRatio * scale;
// scaleFixed(); // scaleFixed();
} }
// 取消缩放 // 取消缩放
function removeScale() { function removeScale() {
wrapper.style.width = "100%"; document.body.style.width = "100%";
wrapper.style.height = "100%"; document.body.style.height = "100%";
wrapper.style.transform = ""; document.body.style.transform = "";
wrapper.style.transformOrigin = ""; document.body.style.transformOrigin = "";
wrapper.style["-ms-transform"] = ""; document.body.style["-ms-transform"] = "";
wrapper.style["-ms-transform-origin"] = ""; document.body.style["-ms-transform-origin"] = "";
wrapper.style.overflowY = "hidden"; document.body.style.overflowY = "hidden";
document.body.style.top = "";
html.style.backgroundColor = "#ffffff"; html.style.backgroundColor = "#ffffff";
scale = 1; scale = 1;
document.body.style.top = "0px"; // document.body.style.top = "0px";
document.body.style.width = ""; // document.body.style.width = "";
document.body.style.height = ""; // document.body.style.height = "";
document.body.style.overflowY = ""; // document.body.style.overflowY = "";
window.scale = window.devicePixelRatio / scale; window.scale = window.devicePixelRatio / scale;
// revertFixed(); // revertFixed();
@ -218,20 +219,20 @@
tooltip.element[0].style.transform = "scale(" + scale+ ")"; tooltip.element[0].style.transform = "scale(" + scale+ ")";
tooltip.element[0].style.transformOrigin = "top left"; tooltip.element[0].style.transformOrigin = "top left";
} }
jQuery.fn.outerWidth = function () { // jQuery.fn.outerWidth = function () {
var wdith = injectOuterWidth.apply(this, arguments); // var wdith = injectOuterWidth.apply(this, arguments);
if (this[0] === document.body) { // if (this[0] === document.body) {
return wdith / scale; // return wdith / scale;
} // }
return wdith; // return wdith;
} // }
jQuery.fn.outerHeight = function () { // jQuery.fn.outerHeight = function () {
var height = injectOuterHeight.apply(this, arguments); // var height = injectOuterHeight.apply(this, arguments);
if (this[0] === document.body) { // if (this[0] === document.body) {
return height / scale; // return height / scale;
} // }
return height; // return height;
} // }
// BI.DOM.getBottomPosition = function (combo, popup, extraHeight) { // BI.DOM.getBottomPosition = function (combo, popup, extraHeight) {
// var el = combo.element; // var el = combo.element;
// return { // return {

Loading…
Cancel
Save