aboutsummaryrefslogtreecommitdiff
path: root/ext/fg/js/popup.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.js
parent5c4614f585648c2b835efc1d369e78918bc4f5ff (diff)
Add option for maximum nested popup depth
Diffstat (limited to 'ext/fg/js/popup.js')
-rw-r--r--ext/fg/js/popup.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/fg/js/popup.js b/ext/fg/js/popup.js
index f6b4f6d9..00dfeb89 100644
--- a/ext/fg/js/popup.js
+++ b/ext/fg/js/popup.js
@@ -18,15 +18,16 @@
class Popup {
- constructor(id) {
+ constructor(id, depth) {
this.id = id;
+ this.depth = depth;
this.parent = null;
this.children = [];
this.container = document.createElement('iframe');
this.container.id = 'yomichan-float';
this.container.addEventListener('mousedown', e => e.stopPropagation());
this.container.addEventListener('scroll', e => e.stopPropagation());
- this.container.setAttribute('src', chrome.extension.getURL(`/fg/float.html?id=${id}`));
+ this.container.setAttribute('src', chrome.extension.getURL(`/fg/float.html?id=${id}&depth=${depth}`));
this.container.style.width = '0px';
this.container.style.height = '0px';
this.injected = null;