From 36354856f9d6c6f317b2396f20dd96886fd0c885 Mon Sep 17 00:00:00 2001 From: Alexander Zobnin Date: Mon, 22 Oct 2018 15:59:08 +0300 Subject: [PATCH] graph legend: minor refactor --- .../colorpicker/SeriesColorPicker.tsx | 4 ++ .../panel/graph/Legend/LegendSeriesItem.tsx | 56 ++++++++++--------- 2 files changed, 33 insertions(+), 27 deletions(-) diff --git a/public/app/core/components/colorpicker/SeriesColorPicker.tsx b/public/app/core/components/colorpicker/SeriesColorPicker.tsx index ae744da423d..4fa2cc3f2b9 100644 --- a/public/app/core/components/colorpicker/SeriesColorPicker.tsx +++ b/public/app/core/components/colorpicker/SeriesColorPicker.tsx @@ -26,6 +26,10 @@ export class SeriesColorPicker extends React.Component { this.openColorPicker = this.openColorPicker.bind(this); } + componentWillUnmount() { + this.destroyDrop(); + } + openColorPicker() { if (this.colorPickerDrop) { this.destroyDrop(); diff --git a/public/app/plugins/panel/graph/Legend/LegendSeriesItem.tsx b/public/app/plugins/panel/graph/Legend/LegendSeriesItem.tsx index 6c50e4f1c58..55a28fc10b0 100644 --- a/public/app/plugins/panel/graph/Legend/LegendSeriesItem.tsx +++ b/public/app/plugins/panel/graph/Legend/LegendSeriesItem.tsx @@ -61,10 +61,36 @@ export class LegendItem extends React.PureComponent