mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
EventBus: Introduces new event bus with emitter backward compatible interface (#27564)
* updated * Experimenting with event bus with legacy support * Before switch to emitter * EventBus & Emitter unification * Everything using new EventBus * Making progress * Fixing merge issues * Final merge issues * Updated * Updates * Fix * Updated * Update * Update * Rename methods to publish and subscribe * Ts fixes * Updated * updated * fixing doc warnigns * removed unused file
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import $ from 'jquery';
|
||||
import { appEvents } from 'app/core/core';
|
||||
import { CoreEvents } from 'app/types';
|
||||
import { textUtil, systemDateFormats } from '@grafana/data';
|
||||
import { textUtil, systemDateFormats, LegacyGraphHoverClearEvent, LegacyGraphHoverEvent } from '@grafana/data';
|
||||
|
||||
export default function GraphTooltip(this: any, elem: any, dashboard: any, scope: any, getSeriesFn: any) {
|
||||
const self = this;
|
||||
@@ -157,7 +157,7 @@ export default function GraphTooltip(this: any, elem: any, dashboard: any, scope
|
||||
plot.unhighlight();
|
||||
}
|
||||
}
|
||||
appEvents.emit(CoreEvents.graphHoverClear);
|
||||
dashboard.events.$emit(new LegacyGraphHoverClearEvent());
|
||||
});
|
||||
|
||||
elem.bind('plothover', (event: any, pos: { panelRelY: number; pageY: number }, item: any) => {
|
||||
@@ -165,7 +165,7 @@ export default function GraphTooltip(this: any, elem: any, dashboard: any, scope
|
||||
|
||||
// broadcast to other graph panels that we are hovering!
|
||||
pos.panelRelY = (pos.pageY - elem.offset().top) / elem.height();
|
||||
appEvents.emit(CoreEvents.graphHover, { pos: pos, panel: panel });
|
||||
dashboard.events.$emit(new LegacyGraphHoverEvent({ pos: pos, panel: panel }));
|
||||
});
|
||||
|
||||
elem.bind('plotclick', (event: any, pos: any, item: any) => {
|
||||
|
||||
Reference in New Issue
Block a user