mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Merge branch 'shared_tooltip' of https://github.com/connection-reset/grafana into connection-reset-shared_tooltip
This commit is contained in:
@@ -34,6 +34,9 @@ module.directive('grafanaGraph', function($rootScope, timeSrv) {
|
||||
var rootScope = scope.$root;
|
||||
var panelWidth = 0;
|
||||
var thresholdManager = new ThresholdManager(ctrl);
|
||||
var tooltip = new GraphTooltip(elem, dashboard, scope, function() {
|
||||
return sortedSeries;
|
||||
});
|
||||
var plot;
|
||||
|
||||
ctrl.events.on('panel-teardown', () => {
|
||||
@@ -64,6 +67,19 @@ module.directive('grafanaGraph', function($rootScope, timeSrv) {
|
||||
}
|
||||
}, scope);
|
||||
|
||||
rootScope.onAppEvent('setTooltip', function(event, info) {
|
||||
// do not need to to this if event is from this panel
|
||||
// or another panel is in fullscreen mode
|
||||
if (info.scope === scope || ctrl.otherPanelInFullscreenMode()) {
|
||||
return;
|
||||
}
|
||||
tooltip.setTooltip(info.pos);
|
||||
}, scope);
|
||||
|
||||
rootScope.onAppEvent('clearTooltip', function() {
|
||||
tooltip.clearTooltip();
|
||||
}, scope);
|
||||
|
||||
// Receive render events
|
||||
ctrl.events.on('render', function(renderData) {
|
||||
data = renderData || data;
|
||||
@@ -565,10 +581,6 @@ module.directive('grafanaGraph', function($rootScope, timeSrv) {
|
||||
return "%H:%M";
|
||||
}
|
||||
|
||||
var tooltip = new GraphTooltip(elem, dashboard, scope, function() {
|
||||
return sortedSeries;
|
||||
});
|
||||
|
||||
elem.bind("plotselected", function (event, ranges) {
|
||||
scope.$apply(function() {
|
||||
timeSrv.setTime({
|
||||
|
||||
Reference in New Issue
Block a user