From 196fdbfd3104d0e5f0be10132f7b5d9a5bf47121 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Thu, 17 Nov 2016 10:31:37 +0100 Subject: [PATCH] fix(dashboard): fixed issue when dragging new panel to drop zone --- public/app/features/dashboard/row/row_ctrl.ts | 3 ++- public/app/features/panel/panel_ctrl.ts | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/public/app/features/dashboard/row/row_ctrl.ts b/public/app/features/dashboard/row/row_ctrl.ts index 5953889a9b1..e28f576c8ba 100644 --- a/public/app/features/dashboard/row/row_ctrl.ts +++ b/public/app/features/dashboard/row/row_ctrl.ts @@ -34,6 +34,7 @@ export class DashRowCtrl { title: config.new_panel_title, type: panelId, id: this.dashboard.getNextPanelId(), + isNew: true, }, }; } else { @@ -63,7 +64,7 @@ export class DashRowCtrl { this.row.panels.push(dragObject.panel); // if not new remove from source row - if (!dragObject.isNew) { + if (!dragObject.panel.isNew) { dragObject.row.removePanel(dragObject.panel, false); } } diff --git a/public/app/features/panel/panel_ctrl.ts b/public/app/features/panel/panel_ctrl.ts index 1d1b7c7f4a2..3bd6cef569d 100644 --- a/public/app/features/panel/panel_ctrl.ts +++ b/public/app/features/panel/panel_ctrl.ts @@ -54,6 +54,12 @@ export class PanelCtrl { this.events.emit('panel-teardown'); this.events.removeAllListeners(); }); + + // we should do something interesting + // with newly added panels + if (this.panel.isNew) { + delete this.panel.isNew; + } } init() {