Browse Source

REPORT-119215 fix: 统一获取宽高的方法

research/test
jian 7 months ago
parent
commit
b1da50461b
  1. 16
      packages/fineui/src/core/controller/controller.popover.js

16
packages/fineui/src/core/controller/controller.popover.js

@ -38,7 +38,7 @@ export class PopoverController extends Controller {
type: "bi.popover",
}, context);
this.add(name, popover, options, context);
return this;
}
@ -58,8 +58,8 @@ export class PopoverController extends Controller {
const popover = this.get(name);
popover.show && popover.show();
const render = this.getRender();
const W = Widget._renderEngine.createElement(render).width(),
H = Widget._renderEngine.createElement(render).height();
const elRect = Widget._renderEngine.createElement(render)[0].getBoundingClientRect();
const W = elRect.width, H = elRect.height;
const w = popover.element.width(), h = popover.element.height();
let left = (W - w) / 2, top = (H - h) / 2;
if (left < 0) {
@ -74,7 +74,7 @@ export class PopoverController extends Controller {
top: `${top}px`,
});
}
return this;
}
@ -87,7 +87,7 @@ export class PopoverController extends Controller {
this.floatContainer[name].invisible();
this.modal && this.floatContainer[name].element.__releaseZIndexMask__(this.zindexMap[name]);
}
return this;
}
@ -135,7 +135,7 @@ export class PopoverController extends Controller {
bottom: 0,
}],
});
return this;
}
@ -167,7 +167,7 @@ export class PopoverController extends Controller {
delete this.zindexMap[name];
delete this.floatContainer[name];
delete this.floatOpened[name];
return this;
}
@ -181,7 +181,7 @@ export class PopoverController extends Controller {
this.floatContainer = {};
this.floatOpened = {};
this.zindexMap = {};
return this;
}

Loading…
Cancel
Save