Browse Source

BI-49097 位置问题

feature/10.0
Fay 5 years ago
parent
commit
8daba057cd
  1. 23
      src/main/resources/com/finebi/plugin/web/plugin.screen_adaptive.js
  2. 23
      src/main/resources/com/finebi/plugin/web/scripts/entry.js

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

@ -8,6 +8,7 @@
var injectEventFix = jQuery.event.fix;
var injectMouseInBounds = jQuery.fn.__isMouseInBounds__;
var injectToolTipShow = null;
var injectBubblesShow = null;
var adjustHeight = BI.Combo.prototype.adjustHeight;
var injectOuterWidth = jQuery.fn.outerWidth;
var injectOuterHeight = jQuery.fn.outerHeight;
@ -125,6 +126,7 @@
function prepareEnv() {
// IE的fixed元素不受transform:scale影响
injectToolTipShow = injectToolTipShow || BI.Tooltips.show;
injectBubblesShow = injectBubblesShow || BI.Bubbles.show;
jQuery.fn.__isMouseInBounds__ = function (e) {
var offset2Body = this.get(0).getBoundingClientRect ? this.get(0).getBoundingClientRect() : this.offset();
var width = offset2Body.width || this.outerWidth();
@ -179,11 +181,14 @@
} while( el );
var elm = elem;
do{
offsetLeft -= elm.scrollLeft || 0;
offsetTop -= elm.scrollTop || 0;
elm = elm.parentNode;
} while( elm );
// 不知道该怎么写代码了,就这样了
if (!checkInPopupView(elm)) {
do{
offsetLeft -= elm.scrollLeft || 0;
offsetTop -= elm.scrollTop || 0;
elm = elm.parentNode;
} while( elm );
}
win = getWindow( doc );
return {
top: offsetTop + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ),
@ -218,6 +223,14 @@
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.transform = "scale(" + scale+ ")";
tooltip.element[0].style.transformOrigin = "top left";
}
// jQuery.fn.outerWidth = function () {
// var wdith = injectOuterWidth.apply(this, arguments);
// if (this[0] === document.body) {

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

@ -8,6 +8,7 @@
var injectEventFix = jQuery.event.fix;
var injectMouseInBounds = jQuery.fn.__isMouseInBounds__;
var injectToolTipShow = null;
var injectBubblesShow = null;
var adjustHeight = BI.Combo.prototype.adjustHeight;
var injectOuterWidth = jQuery.fn.outerWidth;
var injectOuterHeight = jQuery.fn.outerHeight;
@ -125,6 +126,7 @@
function prepareEnv() {
// IE的fixed元素不受transform:scale影响
injectToolTipShow = injectToolTipShow || BI.Tooltips.show;
injectBubblesShow = injectBubblesShow || BI.Bubbles.show;
jQuery.fn.__isMouseInBounds__ = function (e) {
var offset2Body = this.get(0).getBoundingClientRect ? this.get(0).getBoundingClientRect() : this.offset();
var width = offset2Body.width || this.outerWidth();
@ -179,11 +181,14 @@
} while( el );
var elm = elem;
do{
offsetLeft -= elm.scrollLeft || 0;
offsetTop -= elm.scrollTop || 0;
elm = elm.parentNode;
} while( elm );
// 不知道该怎么写代码了,就这样了
if (!checkInPopupView(elm)) {
do{
offsetLeft -= elm.scrollLeft || 0;
offsetTop -= elm.scrollTop || 0;
elm = elm.parentNode;
} while( elm );
}
win = getWindow( doc );
return {
top: offsetTop + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ),
@ -218,6 +223,14 @@
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.transform = "scale(" + scale+ ")";
tooltip.element[0].style.transformOrigin = "top left";
}
// jQuery.fn.outerWidth = function () {
// var wdith = injectOuterWidth.apply(this, arguments);
// if (this[0] === document.body) {

Loading…
Cancel
Save