summaryrefslogtreecommitdiff
path: root/ext/fg/js/popup-proxy-host.js
diff options
context:
space:
mode:
authorsiikamiika <siikamiika@users.noreply.github.com>2020-03-09 02:10:28 +0200
committersiikamiika <siikamiika@users.noreply.github.com>2020-03-09 02:10:28 +0200
commite2bf22831ab9aa26a6f30ff75c584202f79dc523 (patch)
treeb31a9e2017d3678f515b60ed2770e38c42bc26f6 /ext/fg/js/popup-proxy-host.js
parenta0d8caffb4f83e0e7219318fa08839ee93e653b8 (diff)
start popup depth from 1 on search page
Diffstat (limited to 'ext/fg/js/popup-proxy-host.js')
-rw-r--r--ext/fg/js/popup-proxy-host.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/ext/fg/js/popup-proxy-host.js b/ext/fg/js/popup-proxy-host.js
index 7d86aa67..fdb54cdd 100644
--- a/ext/fg/js/popup-proxy-host.js
+++ b/ext/fg/js/popup-proxy-host.js
@@ -47,7 +47,7 @@ class PopupProxyHost {
]));
}
- getOrCreatePopup(id=null, parentId=null) {
+ getOrCreatePopup(id=null, parentId=null, depth=0) {
// Find by existing id
if (id !== null) {
const popup = this._popups.get(id);
@@ -76,7 +76,12 @@ class PopupProxyHost {
}
// Create new popup
- const depth = (parent !== null ? parent.depth + 1 : 0);
+ if (parent !== null) {
+ if (depth !== 0) {
+ throw new Error('Depth cannot be set when parent exists');
+ }
+ depth = parent.depth + 1;
+ }
const popup = new Popup(id, depth, this._frameIdPromise);
if (parent !== null) {
popup.setParent(parent);