aboutsummaryrefslogtreecommitdiff
path: root/ext/fg/js/popup.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/fg/js/popup.js')
-rw-r--r--ext/fg/js/popup.js11
1 files changed, 3 insertions, 8 deletions
diff --git a/ext/fg/js/popup.js b/ext/fg/js/popup.js
index 92ade784..16a62b1c 100644
--- a/ext/fg/js/popup.js
+++ b/ext/fg/js/popup.js
@@ -33,11 +33,10 @@ class Popup {
this.setContent(content);
}
- showNextTo(element, content) {
+ showNextTo(elementRect, content) {
this.inject();
- const elementRect = element.getBoundingClientRect();
- const popupRect = this.popup.getBoundingClientRect();
+ const popupRect = this.popup.getBoundingClientRect();
let posX = elementRect.left;
if (posX + popupRect.width >= window.innerWidth) {
@@ -49,11 +48,7 @@ class Popup {
posY = elementRect.top - popupRect.height - this.offset;
}
- this.popup.style.left = posX + 'px';
- this.popup.style.top = posY + 'px';
- this.popup.style.visibility = 'visible';
-
- this.setContent(content);
+ this.showAt({x: posX, y: posY}, content);
}
hide() {