Commit f5454777 by Alexander Zobnin Committed by Torkel Ödegaard

graph: disable zoom in non-timeseries modes (#9914)

parent 66e42978
...@@ -688,7 +688,14 @@ function graphDirective($rootScope, timeSrv, popoverSrv, contextSrv) { ...@@ -688,7 +688,14 @@ function graphDirective($rootScope, timeSrv, popoverSrv, contextSrv) {
} }
elem.bind("plotselected", function (event, ranges) { elem.bind("plotselected", function (event, ranges) {
if (panel.xaxis.mode !== 'time') {
// Skip if panel in histogram or series mode
plot.clearSelection();
return;
}
if ((ranges.ctrlKey || ranges.metaKey) && contextSrv.isEditor) { if ((ranges.ctrlKey || ranges.metaKey) && contextSrv.isEditor) {
// Add annotation
setTimeout(() => { setTimeout(() => {
eventManager.updateTime(ranges.xaxis); eventManager.updateTime(ranges.xaxis);
}, 100); }, 100);
...@@ -703,6 +710,11 @@ function graphDirective($rootScope, timeSrv, popoverSrv, contextSrv) { ...@@ -703,6 +710,11 @@ function graphDirective($rootScope, timeSrv, popoverSrv, contextSrv) {
}); });
elem.bind("plotclick", function (event, pos, item) { elem.bind("plotclick", function (event, pos, item) {
if (panel.xaxis.mode !== 'time') {
// Skip if panel in histogram or series mode
return;
}
if ((pos.ctrlKey || pos.metaKey) && contextSrv.isEditor) { if ((pos.ctrlKey || pos.metaKey) && contextSrv.isEditor) {
// Skip if range selected (added in "plotselected" event handler) // Skip if range selected (added in "plotselected" event handler)
let isRangeSelection = pos.x !== pos.x1; let isRangeSelection = pos.x !== pos.x1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment