mirror of
https://github.com/grafana/grafana.git
synced 2024-11-26 02:40:26 -06:00
dashboards: fix keyboard shortcut for expand/collapse rows
This commit is contained in:
parent
609f3c1c9d
commit
34f1611d18
@ -213,16 +213,12 @@ export class KeybindingSrv {
|
||||
|
||||
// collapse all rows
|
||||
this.bind('d shift+c', () => {
|
||||
for (let row of dashboard.rows) {
|
||||
row.collapse = true;
|
||||
}
|
||||
dashboard.collapseRows();
|
||||
});
|
||||
|
||||
// expand all rows
|
||||
this.bind('d shift+e', () => {
|
||||
for (let row of dashboard.rows) {
|
||||
row.collapse = false;
|
||||
}
|
||||
dashboard.expandRows();
|
||||
});
|
||||
|
||||
this.bind('d n', e => {
|
||||
|
@ -524,6 +524,34 @@ export class DashboardModel {
|
||||
this.removePanel(row);
|
||||
}
|
||||
|
||||
expandRows() {
|
||||
for (let i = 0; i < this.panels.length; i++) {
|
||||
var panel = this.panels[i];
|
||||
|
||||
if (panel.type !== 'row') {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (panel.collapsed) {
|
||||
this.toggleRow(panel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
collapseRows() {
|
||||
for (let i = 0; i < this.panels.length; i++) {
|
||||
var panel = this.panels[i];
|
||||
|
||||
if (panel.type !== 'row') {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!panel.collapsed) {
|
||||
this.toggleRow(panel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
setPanelFocus(id) {
|
||||
this.meta.focusPanelId = id;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user