From eaef854bcf68be368ea15b2a846dd06c06f817c5 Mon Sep 17 00:00:00 2001 From: tophf Date: Fri, 24 Sep 2021 19:18:57 +0300 Subject: [PATCH] show iframe "+" only if there's a unique url --- popup/popup.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/popup/popup.js b/popup/popup.js index 2c2b864f..6bfb6d0a 100644 --- a/popup/popup.js +++ b/popup/popup.js @@ -140,11 +140,10 @@ async function initPopup(frames) { } frames.forEach(createWriterElement); - if (frames.length > 1) { - const el = $('#write-for-frames'); - el.hidden = false; - el.onclick = () => el.classList.toggle('expanded'); - } + Object.assign($('#write-for-frames'), { + onclick: e => e.currentTarget.classList.toggle('expanded'), + hidden: frames.length < 2 || !$('.match .match:not(.dupe)'), + }); const isStore = tabURL.startsWith(URLS.browserWebStore); if (isStore && !FIREFOX) {