diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2020-09-05 22:03:35 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-05 22:03:35 -0400 |
commit | 44f38c4dea6d517bb7657063ed2394745945c1f8 (patch) | |
tree | 9a1e9f4eb781a8b551730284a6360cdcb6bf9c0a /ext/fg/js/popup-factory.js | |
parent | 55770934f807d94d35a99e739b2ee326bfd4afbd (diff) |
Popup window (#773)
* Add option usePopupWindow
* Add PopupWindow class
* Add support for creating PopupWindow
Diffstat (limited to 'ext/fg/js/popup-factory.js')
-rw-r--r-- | ext/fg/js/popup-factory.js | 13 |
1 files changed, 11 insertions, 2 deletions
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); |