Add getContainerRect to popup

This commit is contained in:
toasted-nutbread 2019-12-15 21:09:51 -05:00
parent 37da5fef59
commit 4ba93b0770
2 changed files with 5 additions and 1 deletions

View File

@ -129,7 +129,7 @@ class PopupProxyHost {
let x = jsonRect.x; let x = jsonRect.x;
let y = jsonRect.y; let y = jsonRect.y;
if (popup.parent !== null) { if (popup.parent !== null) {
const popupRect = popup.parent.container.getBoundingClientRect(); const popupRect = popup.parent.getContainerRect();
x += popupRect.x; x += popupRect.x;
y += popupRect.y; y += popupRect.y;
} }

View File

@ -135,6 +135,10 @@ class Popup {
} }
} }
getContainerRect() {
return this.container.getBoundingClientRect();
}
static injectOuterStylesheet(css) { static injectOuterStylesheet(css) {
if (Popup.outerStylesheet === null) { if (Popup.outerStylesheet === null) {
if (!css) { return; } if (!css) { return; }