Skip to content

Commit 196fdbf

Browse files
committed
fix(dashboard): fixed issue when dragging new panel to drop zone
1 parent a45fdfd commit 196fdbf

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

public/app/features/dashboard/row/row_ctrl.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export class DashRowCtrl {
3434
title: config.new_panel_title,
3535
type: panelId,
3636
id: this.dashboard.getNextPanelId(),
37+
isNew: true,
3738
},
3839
};
3940
} else {
@@ -63,7 +64,7 @@ export class DashRowCtrl {
6364
this.row.panels.push(dragObject.panel);
6465

6566
// if not new remove from source row
66-
if (!dragObject.isNew) {
67+
if (!dragObject.panel.isNew) {
6768
dragObject.row.removePanel(dragObject.panel, false);
6869
}
6970
}

public/app/features/panel/panel_ctrl.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ export class PanelCtrl {
5454
this.events.emit('panel-teardown');
5555
this.events.removeAllListeners();
5656
});
57+
58+
// we should do something interesting
59+
// with newly added panels
60+
if (this.panel.isNew) {
61+
delete this.panel.isNew;
62+
}
5763
}
5864

5965
init() {

0 commit comments

Comments
 (0)