aboutsummaryrefslogtreecommitdiff
path: root/ext/fg/js/popup-proxy-host.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-08-17 19:32:58 -0400
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-09-02 19:32:08 -0400
commit1a9348ec27b903af47511da11306f884a82cf353 (patch)
treeba890d2a69b83281d34209d8841a6be83d713d23 /ext/fg/js/popup-proxy-host.js
parent5c4614f585648c2b835efc1d369e78918bc4f5ff (diff)
Add option for maximum nested popup depth
Diffstat (limited to 'ext/fg/js/popup-proxy-host.js')
-rw-r--r--ext/fg/js/popup-proxy-host.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/fg/js/popup-proxy-host.js b/ext/fg/js/popup-proxy-host.js
index 189481bc..ba3db832 100644
--- a/ext/fg/js/popup-proxy-host.js
+++ b/ext/fg/js/popup-proxy-host.js
@@ -36,9 +36,10 @@ class PopupProxyHost {
createPopup(parentId) {
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}`;
++this.nextId;
- const popup = new Popup(id);
+ const popup = new Popup(id, depth);
if (parent !== null) {
popup.parent = parent;
parent.children.push(popup);