diff options
Diffstat (limited to 'ext/fg/js/popup-proxy-host.js')
-rw-r--r-- | ext/fg/js/popup-proxy-host.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/ext/fg/js/popup-proxy-host.js b/ext/fg/js/popup-proxy-host.js index bb323f64..f97d44ac 100644 --- a/ext/fg/js/popup-proxy-host.js +++ b/ext/fg/js/popup-proxy-host.js @@ -50,10 +50,12 @@ class PopupProxyHost { }); } - createPopup(parentId) { + createPopup(parentId, depth) { const parent = (typeof parentId === 'string' && this.popups.hasOwnProperty(parentId) ? this.popups[parentId] : null); - const depth = (parent !== null ? parent.depth + 1 : 0); const id = `${this.nextId}`; + if (parent !== null) { + depth = parent.depth + 1; + } ++this.nextId; const popup = new Popup(id, depth, this.frameIdPromise); if (parent !== null) { @@ -65,7 +67,7 @@ class PopupProxyHost { } async createNestedPopup(parentId) { - return this.createPopup(parentId).id; + return this.createPopup(parentId, 0).id; } getPopup(id) { |