From 4ba93b07706745ea4d3ba21598e686275b8fa5f1 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sun, 15 Dec 2019 21:09:51 -0500 Subject: [PATCH] Add getContainerRect to popup --- ext/fg/js/popup-proxy-host.js | 2 +- ext/fg/js/popup.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ext/fg/js/popup-proxy-host.js b/ext/fg/js/popup-proxy-host.js index bf6604e5..697c8077 100644 --- a/ext/fg/js/popup-proxy-host.js +++ b/ext/fg/js/popup-proxy-host.js @@ -129,7 +129,7 @@ class PopupProxyHost { let x = jsonRect.x; let y = jsonRect.y; if (popup.parent !== null) { - const popupRect = popup.parent.container.getBoundingClientRect(); + const popupRect = popup.parent.getContainerRect(); x += popupRect.x; y += popupRect.y; } diff --git a/ext/fg/js/popup.js b/ext/fg/js/popup.js index 0f6af1a5..46a09548 100644 --- a/ext/fg/js/popup.js +++ b/ext/fg/js/popup.js @@ -135,6 +135,10 @@ class Popup { } } + getContainerRect() { + return this.container.getBoundingClientRect(); + } + static injectOuterStylesheet(css) { if (Popup.outerStylesheet === null) { if (!css) { return; }