From 1a9348ec27b903af47511da11306f884a82cf353 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sat, 17 Aug 2019 19:32:58 -0400 Subject: Add option for maximum nested popup depth --- ext/fg/js/popup.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ext/fg/js/popup.js') 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; -- cgit v1.2.3