diff options
author | hackademix <giorgio@maone.net> | 2019-04-12 01:26:11 +0200 |
---|---|---|
committer | hackademix <giorgio@maone.net> | 2019-04-12 01:26:11 +0200 |
commit | 0aacfa705e307286aa87861de5442785b1b51f65 (patch) | |
tree | fea981b071d8b3c651b04a398c1cd4d325b09df3 /html | |
parent | 2bee3260b45b559eb3bc75c6421dc7e573571cdb (diff) |
More consistent and efficient blacklisting.
Diffstat (limited to 'html')
-rw-r--r-- | html/display_panel/content/main_panel.js | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/html/display_panel/content/main_panel.js b/html/display_panel/content/main_panel.js index 75de6aa..32d1bda 100644 --- a/html/display_panel/content/main_panel.js +++ b/html/display_panel/content/main_panel.js @@ -59,7 +59,7 @@ document.querySelector("#info").addEventListener("click", e => { setTimeout(close, 100); return; } - if (!button.tagName === "BUTTON") button = button.closest("button"); + if (button.tagName !== "BUTTON") button = button.closest("button"); if (button.matches(".toggle-source")) { let parent = button.parentNode; if (!parent.querySelector(".source").textContent) { @@ -199,12 +199,17 @@ function refreshUI(report) { } if (siteStatus && siteStatus !== "unknown") { + let siteContainer = document.querySelector("#site"); let statusLabel = siteStatus; - if (listedSite && listedSite !== report.site) statusLabel += ` via ${listedSite}`; - let status = document.querySelector("#site .status"); + if (listedSite && listedSite !== report.site) { + statusLabel += ` via ${listedSite}`; + siteContainer.querySelector(".forget").disabled = true; + } + let status = siteContainer.querySelector(".status"); status.classList.add(siteStatus); - document.querySelector("#site .status").textContent = statusLabel; - document.querySelector("#site .forget").disabled = true; + status.textContent = statusLabel; + } else { + document.querySelector("#site .status").textContent = ""; } let noscript = scriptsCount === 0; |