mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
fix(dashboard): fixed issue when dragging new panel to drop zone
This commit is contained in:
parent
a45fdfdd3f
commit
196fdbfd31
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user