mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
ux(dashboard): added more shortcusts to v/edit panel, #6442
This commit is contained in:
@@ -105,6 +105,14 @@ export class KeybindingSrv {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.bind('v', () => {
|
||||||
|
if (dashboard.meta.focusPanelId) {
|
||||||
|
this.$rootScope.appEvent('panel-change-view', {
|
||||||
|
fullscreen: true, edit: null, panelId: dashboard.meta.focusPanelId
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
this.bind('d', () => {
|
this.bind('d', () => {
|
||||||
if (dashboard.meta.focusPanelId && dashboard.meta.canEdit) {
|
if (dashboard.meta.focusPanelId && dashboard.meta.canEdit) {
|
||||||
var panelInfo = dashboard.getPanelInfoById(dashboard.meta.focusPanelId);
|
var panelInfo = dashboard.getPanelInfoById(dashboard.meta.focusPanelId);
|
||||||
|
|||||||
@@ -93,6 +93,7 @@ export class AddPanelCtrl {
|
|||||||
isNew: true,
|
isNew: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.rowCtrl.dropView = 0;
|
||||||
this.dashboard.addPanel(panel, this.row);
|
this.dashboard.addPanel(panel, this.row);
|
||||||
this.$timeout(() => {
|
this.$timeout(() => {
|
||||||
this.$rootScope.$broadcast('render');
|
this.$rootScope.$broadcast('render');
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ export class DashRowCtrl {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.dropView = 0;
|
||||||
this.row.panelSpanChanged();
|
this.row.panelSpanChanged();
|
||||||
this.$timeout(() => {
|
this.$timeout(() => {
|
||||||
this.$rootScope.$broadcast('render');
|
this.$rootScope.$broadcast('render');
|
||||||
|
|||||||
@@ -83,6 +83,13 @@ function (angular, _, $) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
DashboardViewState.prototype.update = function(state) {
|
DashboardViewState.prototype.update = function(state) {
|
||||||
|
// implement toggle logic
|
||||||
|
if (this.state.fullscreen && state.fullscreen) {
|
||||||
|
if (this.state.edit === state.edit) {
|
||||||
|
state.fullscreen = !state.fullscreen;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// remember if editStateChanged
|
// remember if editStateChanged
|
||||||
this.editStateChanged = state.edit !== this.state.edit;
|
this.editStateChanged = state.edit !== this.state.edit;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user