From 295ffa6e54d04cedef35a4798cabdae71f824ee1 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Wed, 8 Jul 2020 19:50:13 -0400 Subject: 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 --- ext/fg/js/popup-factory.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'ext/fg/js/popup-factory.js') 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 }; -- cgit v1.2.3