Skip to content

Commit 47aae7f

Browse files
committed
ux(dashboard): added more shortcusts to v/edit panel, grafana#6442
1 parent 95e7ead commit 47aae7f

File tree

4 files changed

+17
-0
lines changed

4 files changed

+17
-0
lines changed

public/app/core/services/keybindingSrv.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,14 @@ export class KeybindingSrv {
105105
}
106106
});
107107

108+
this.bind('v', () => {
109+
if (dashboard.meta.focusPanelId) {
110+
this.$rootScope.appEvent('panel-change-view', {
111+
fullscreen: true, edit: null, panelId: dashboard.meta.focusPanelId
112+
});
113+
}
114+
});
115+
108116
this.bind('d', () => {
109117
if (dashboard.meta.focusPanelId && dashboard.meta.canEdit) {
110118
var panelInfo = dashboard.getPanelInfoById(dashboard.meta.focusPanelId);

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ export class AddPanelCtrl {
9393
isNew: true,
9494
};
9595

96+
this.rowCtrl.dropView = 0;
9697
this.dashboard.addPanel(panel, this.row);
9798
this.$timeout(() => {
9899
this.$rootScope.$broadcast('render');

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ export class DashRowCtrl {
7070
}
7171
}
7272

73+
this.dropView = 0;
7374
this.row.panelSpanChanged();
7475
this.$timeout(() => {
7576
this.$rootScope.$broadcast('render');

public/app/features/dashboard/viewStateSrv.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,13 @@ function (angular, _, $) {
8383
};
8484

8585
DashboardViewState.prototype.update = function(state) {
86+
// implement toggle logic
87+
if (this.state.fullscreen && state.fullscreen) {
88+
if (this.state.edit === state.edit) {
89+
state.fullscreen = !state.fullscreen;
90+
}
91+
}
92+
8693
// remember if editStateChanged
8794
this.editStateChanged = state.edit !== this.state.edit;
8895

0 commit comments

Comments
 (0)