annotations: you can now read annoations via manually created annoation query

This commit is contained in:
Torkel Ödegaard
2017-04-12 15:46:41 +02:00
parent 78f4bd2de9
commit 0156a94a49
9 changed files with 21 additions and 11 deletions

View File

@@ -84,7 +84,7 @@ coreModule.directive('grafanaGraph', function($rootScope, timeSrv) {
let thisPanelEvent = event.panel.id === ctrl.panel.id;
// Select time for new annotation
let createAnnotation = ctrl.inAddAnnotationMode || event.pos.ctrlKey || event.pos.metaKey;
let createAnnotation = event.pos.ctrlKey || event.pos.metaKey;
if (createAnnotation && thisPanelEvent) {
let timeRange = {
from: event.pos.x,
@@ -92,7 +92,6 @@ coreModule.directive('grafanaGraph', function($rootScope, timeSrv) {
};
ctrl.showAddAnnotationModal(timeRange);
ctrl.inAddAnnotationMode = false;
}
}, scope);
@@ -656,12 +655,11 @@ coreModule.directive('grafanaGraph', function($rootScope, timeSrv) {
}
elem.bind("plotselected", function (event, ranges) {
if (ctrl.inAddAnnotationMode || ranges.ctrlKey || ranges.metaKey) {
if (ranges.ctrlKey || ranges.metaKey) {
// Create new annotation from time range
let timeRange = ranges.xaxis;
ctrl.showAddAnnotationModal(timeRange);
plot.clearSelection();
ctrl.inAddAnnotationMode = false;
} else {
scope.$apply(function() {
timeSrv.setTime({