Open Query Log with filtering option on Query Type when left-clicking on an element in the pie-chart. The current behavior is moved to middle mouse click.

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2018-08-15 14:23:17 +02:00
parent da2a6fec69
commit 6f7e1b5b59

View File

@@ -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