From 87e49b2e079ca5b4366a309a6a41428a2be54575 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Sat, 23 May 2020 17:02:27 +0300 Subject: [PATCH] Fix `.context` usage in our code Signed-off-by: XhmikosR --- scripts/pi-hole/js/auditlog.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/pi-hole/js/auditlog.js b/scripts/pi-hole/js/auditlog.js index 1212eb73..d794fa1d 100644 --- a/scripts/pi-hole/js/auditlog.js +++ b/scripts/pi-hole/js/auditlog.js @@ -131,18 +131,20 @@ $(function () { // Pull in data via AJAX updateTopLists(); - $("#domain-frequency tbody").on("click", "button", function () { + $("#domain-frequency tbody").on("click", "button", function (event) { var url = $(this).parents("tr")[0].textContent.split(" ")[0]; - if ($(this).context.textContent === " Blacklist") { + + if (event.target.textContent.trim() === "Blacklist") { blacklistUrl(url); } else { auditUrl(url); } }); - $("#ad-frequency tbody").on("click", "button", function () { + $("#ad-frequency tbody").on("click", "button", function (event) { var url = $(this).parents("tr")[0].textContent.split(" ")[0]; - if ($(this).context.textContent === " Whitelist") { + + if (event.target.textContent.trim() === "Whitelist") { whitelistUrl(url); } else { auditUrl(url);