aboutsummaryrefslogtreecommitdiff
path: root/ext/fg/js/popup-factory.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-05-08 19:10:06 -0400
committerGitHub <noreply@github.com>2020-05-08 19:10:06 -0400
commit48cf6469739b26d4157d79523ccea762ef90d6bd (patch)
tree140f67049e6bc89f1c6d5b6eb6e5020896e9875f /ext/fg/js/popup-factory.js
parent3949db26d778bc3f593438211b148e8309921542 (diff)
Popup refactor (#518)
* Add default * Convert function to non-static * Remove static for private functions * Replace .call * Move functions with side effects into a synchronous prepare function * Rename variables with "container" to "frame" in _initializeFrame * Rename variables with "container" to "frame" * Rename getContainer to getFrame * Rename getContainerRect to getFrameRect * Organize and simplify * Fix incorrect change of "popup" => "this" * Move initial _updateVisibility into prepare()
Diffstat (limited to 'ext/fg/js/popup-factory.js')
-rw-r--r--ext/fg/js/popup-factory.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/fg/js/popup-factory.js b/ext/fg/js/popup-factory.js
index 21e64dd0..b10acbaf 100644
--- a/ext/fg/js/popup-factory.js
+++ b/ext/fg/js/popup-factory.js
@@ -87,6 +87,7 @@ class PopupFactory {
popup.setParent(parent);
}
this._popups.set(id, popup);
+ popup.prepare();
return popup;
}
@@ -168,7 +169,7 @@ class PopupFactory {
_convertPopupPointToRootPagePoint(popup, x, y) {
if (popup.parent !== null) {
- const popupRect = popup.parent.getContainerRect();
+ const popupRect = popup.parent.getFrameRect();
x += popupRect.x;
y += popupRect.y;
}