From cbed026c4def430d4c0307820eb173a5e0525899 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Sun, 3 May 2020 13:41:45 +0200 Subject: [PATCH] Graph: Fixed graph tooltip getting stuck / not being cleared when leaving dashboard, fixes #23881 (#24162) (cherry picked from commit f273e56adc343a084031e253a26194725e6e0e6a) --- public/app/features/dashboard/state/PanelModel.ts | 1 + public/app/features/panel/panel_directive.ts | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/public/app/features/dashboard/state/PanelModel.ts b/public/app/features/dashboard/state/PanelModel.ts index 4be47f235df..fcd988ac060 100644 --- a/public/app/features/dashboard/state/PanelModel.ts +++ b/public/app/features/dashboard/state/PanelModel.ts @@ -467,6 +467,7 @@ export class PanelModel implements DataConfigSource { } destroy() { + this.events.emit(PanelEvents.panelTeardown); this.events.removeAllListeners(); if (this.queryRunner) { diff --git a/public/app/features/panel/panel_directive.ts b/public/app/features/panel/panel_directive.ts index 07b46b76ee0..e3b54b33e89 100644 --- a/public/app/features/panel/panel_directive.ts +++ b/public/app/features/panel/panel_directive.ts @@ -82,9 +82,6 @@ module.directive('grafanaPanel', ($rootScope, $document, $timeout) => { scope.$on('$destroy', () => { elem.off(); - panel.events.emit(PanelEvents.panelTeardown); - panel.events.removeAllListeners(); - if (panelScrollbar) { panelScrollbar.dispose(); }