diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2019-10-15 20:23:25 -0400 |
---|---|---|
committer | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2019-10-15 20:23:25 -0400 |
commit | 16521fec935845828b7e08baf1668657bb5a7cef (patch) | |
tree | 6c965bf0e8962684f08e89f0c87fe595a6727bb2 /ext/fg/js/popup-proxy-host.js | |
parent | 099909287f23bbc9e2deee2e4cd8cf9b17c88618 (diff) |
Assign first popup on the search page as a depth of 1
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) { |