fix(dashboard): fixed issue when dragging new panel to drop zone

This commit is contained in:
Torkel Ödegaard 2016-11-17 10:31:37 +01:00
parent a45fdfdd3f
commit 196fdbfd31
2 changed files with 8 additions and 1 deletions

View File

@ -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);
}
}

View File

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