aboutsummaryrefslogtreecommitdiff
path: root/ext/fg
diff options
context:
space:
mode:
authorsiikamiika <siikamiika@users.noreply.github.com>2020-03-09 11:56:06 +0200
committersiikamiika <siikamiika@users.noreply.github.com>2020-03-09 11:56:06 +0200
commit2ca88b9b9f2a6152e8e953cac284f31c8a285446 (patch)
treea981eaa1d9d01733a0f9a3c228d575a2a77ca4d1 /ext/fg
parente2bf22831ab9aa26a6f30ff75c584202f79dc523 (diff)
strict check if popup depth has been set
Diffstat (limited to 'ext/fg')
-rw-r--r--ext/fg/js/popup-proxy-host.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/fg/js/popup-proxy-host.js b/ext/fg/js/popup-proxy-host.js
index fdb54cdd..49123ee1 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, depth=0) {
+ getOrCreatePopup(id=null, parentId=null, depth=null) {
// Find by existing id
if (id !== null) {
const popup = this._popups.get(id);
@@ -77,10 +77,12 @@ class PopupProxyHost {
// Create new popup
if (parent !== null) {
- if (depth !== 0) {
+ if (depth !== null) {
throw new Error('Depth cannot be set when parent exists');
}
depth = parent.depth + 1;
+ } else if (depth === null) {
+ depth = 0;
}
const popup = new Popup(id, depth, this._frameIdPromise);
if (parent !== null) {