From abfa0a44aeb89bee6af9615b544e6cfd8ee32b9e Mon Sep 17 00:00:00 2001 From: RD WebDesign Date: Wed, 15 Nov 2023 17:18:10 -0300 Subject: [PATCH] Allow open details only on normal rows Detail rows don't have their own details, so don't allow the click event Signed-off-by: RD WebDesign --- scripts/pi-hole/js/queries.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/pi-hole/js/queries.js b/scripts/pi-hole/js/queries.js index 22674e9d..eb8d04f4 100644 --- a/scripts/pi-hole/js/queries.js +++ b/scripts/pi-hole/js/queries.js @@ -603,8 +603,8 @@ $(function () { event.stopPropagation(); }); - // Add event listener for opening and closing details - $("#all-queries tbody").on("click", "tr", function () { + // Add event listener for opening and closing details, except on rows with "details-row" class + $("#all-queries tbody").on("click", "tr:not(.details-row)", function () { var tr = $(this); var row = table.row(tr); @@ -618,8 +618,8 @@ $(function () { row.child.hide(); tr.removeClass("shown"); } else { - // Open this row - row.child(formatInfo(row.data())).show(); + // Open this row. Add a class to the row + row.child(formatInfo(row.data()), "details-row").show(); tr.addClass("shown"); } });