aboutsummaryrefslogtreecommitdiff
path: root/ext/fg/js/popup-factory.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-07-08 19:50:13 -0400
committerGitHub <noreply@github.com>2020-07-08 19:50:13 -0400
commit295ffa6e54d04cedef35a4798cabdae71f824ee1 (patch)
tree8dc2e9dff44f63d1c0f4011094b6a104d35e4185 /ext/fg/js/popup-factory.js
parent128588bb92142950b53ed3f51774c13b35a82fae (diff)
Refactor DisplayFloat=>Frontend message passing (#652)
* Change getOrCreatePopup arguments to be an object * Add ownerFrameId to popup and DisplayFloat * Refactor DisplayFloat host action invocation * Use CrossFrameAPI instead of window.postMessage * Update popup closing functionality on the search page
Diffstat (limited to 'ext/fg/js/popup-factory.js')
-rw-r--r--ext/fg/js/popup-factory.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/fg/js/popup-factory.js b/ext/fg/js/popup-factory.js
index 904f18b9..c48db51a 100644
--- a/ext/fg/js/popup-factory.js
+++ b/ext/fg/js/popup-factory.js
@@ -43,7 +43,7 @@ class PopupFactory {
]);
}
- getOrCreatePopup(id=null, parentId=null, depth=null) {
+ getOrCreatePopup({id=null, parentId=null, ownerFrameId=null, depth=null}) {
// Find by existing id
if (id !== null) {
const popup = this._popups.get(id);
@@ -80,7 +80,7 @@ class PopupFactory {
} else if (depth === null) {
depth = 0;
}
- const popup = new Popup(id, depth, this._frameId);
+ const popup = new Popup(id, depth, this._frameId, ownerFrameId);
if (parent !== null) {
popup.setParent(parent);
}
@@ -91,8 +91,8 @@ class PopupFactory {
// API message handlers
- _onApiGetOrCreatePopup({id, parentId}) {
- const popup = this.getOrCreatePopup(id, parentId);
+ _onApiGetOrCreatePopup({id, parentId, ownerFrameId}) {
+ const popup = this.getOrCreatePopup({id, parentId, ownerFrameId});
return {
id: popup.id
};