dashboard: delete row improvements

Possibility to delete row and all its panels or
only the row which will leave its panels in the dashboard.
This commit is contained in:
Marcus Efraimsson
2017-12-19 15:05:13 +01:00
parent 07432cb4fa
commit bbdb1cddd7
5 changed files with 96 additions and 42 deletions

View File

@@ -469,6 +469,16 @@ export class DashboardModel {
this.events.emit("panel-removed", panel);
}
removeRow(row: PanelModel, removePanels: boolean) {
const needToogle = (!removePanels && row.collapsed) || (removePanels && !row.collapsed);
if (needToogle) {
this.toggleRow(row);
}
this.removePanel(row);
}
setPanelFocus(id) {
this.meta.focusPanelId = id;
}