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() {