From 44f38c4dea6d517bb7657063ed2394745945c1f8 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sat, 5 Sep 2020 22:03:35 -0400 Subject: Popup window (#773) * Add option usePopupWindow * Add PopupWindow class * Add support for creating PopupWindow --- ext/fg/js/popup-factory.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 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 72c875f7..3e817247 100644 --- a/ext/fg/js/popup-factory.js +++ b/ext/fg/js/popup-factory.js @@ -19,6 +19,7 @@ * FrameOffsetForwarder * Popup * PopupProxy + * PopupWindow * api */ @@ -52,7 +53,7 @@ class PopupFactory { ]); } - async getOrCreatePopup({frameId=null, ownerFrameId=null, id=null, parentPopupId=null, depth=null}) { + async getOrCreatePopup({frameId=null, ownerFrameId=null, id=null, parentPopupId=null, depth=null, popupWindow=false}) { // Find by existing id if (id !== null) { const popup = this._popups.get(id); @@ -85,7 +86,15 @@ class PopupFactory { depth = 0; } - if (frameId === this._frameId) { + if (popupWindow) { + // New unique id + if (id === null) { + id = generateId(16); + } + const popup = new PopupWindow(id, depth, this._frameId, ownerFrameId); + this._popups.set(id, popup); + return popup; + } else if (frameId === this._frameId) { // New unique id if (id === null) { id = generateId(16); -- cgit v1.2.3