diff --git a/scripts/pi-hole/js/index.js b/scripts/pi-hole/js/index.js index bd929526..747f8dd7 100644 --- a/scripts/pi-hole/js/index.js +++ b/scripts/pi-hole/js/index.js @@ -280,7 +280,9 @@ function updateQueryTypesPie() { queryTypePieChart.options.animation.duration=0; // Generate legend in separate div $("#query-types-legend").html(queryTypePieChart.generateLegend()); - $("#query-types-legend > ul > li").on("click",function(e){ + $("#query-types-legend > ul > li").on("mousedown", function(e){ + if(e.which == 2) // which == 2 is middle mouse button + { $(this).toggleClass("strike"); var index = $(this).index(); var ci = e.view.queryTypePieChart; @@ -294,6 +296,11 @@ function updateQueryTypesPie() { } } ci.update(); + } + else if(e.which == 1) // which == 1 is left mouse button + { + window.open("queries.php?querytype="+$(this).index(), "_self"); + } }); }).done(function() { // Reload graph after minute @@ -536,7 +543,9 @@ function updateForwardDestinationsPie() { forwardDestinationPieChart.options.animation.duration=0; // Generate legend in separate div $("#forward-destinations-legend").html(forwardDestinationPieChart.generateLegend()); - $("#forward-destinations-legend > ul > li").on("click",function(e){ + $("#forward-destinations-legend > ul > li").on("mousedown",function(e){ + if(e.which == 2) // which == 2 is middle mouse button + { $(this).toggleClass("strike"); var index = $(this).index(); var ci = e.view.forwardDestinationPieChart; @@ -550,6 +559,12 @@ function updateForwardDestinationsPie() { } } ci.update(); + } + else if(e.which == 1) // which == 1 is left mouse button + { + var obj = encodeURIComponent(e.target.innerText); + window.open("queries.php?forwarddest="+obj, "_self"); + } }); }).done(function() { // Reload graph after one minute