Merge pull request #14121 from grafana/panel-size-in-edit-mode-fix

fixed issue with panel size when going into edit mode
pull/14124/head
Torkel Ödegaard 7 years ago committed by GitHub
commit 0053bee886
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      public/app/features/dashboard/panel_model.ts
  2. 13
      public/app/features/panel/panel_directive.ts

@ -95,7 +95,7 @@ export class PanelModel {
setViewMode(fullscreen: boolean, isEditing: boolean) { setViewMode(fullscreen: boolean, isEditing: boolean) {
this.fullscreen = fullscreen; this.fullscreen = fullscreen;
this.isEditing = isEditing; this.isEditing = isEditing;
this.events.emit('panel-size-changed'); this.events.emit('view-mode-changed');
} }
updateGridPos(newPos: GridPos) { updateGridPos(newPos: GridPos) {

@ -140,6 +140,19 @@ module.directive('grafanaPanel', ($rootScope, $document, $timeout) => {
}); });
}); });
ctrl.events.on('view-mode-changed', () => {
// first wait one pass for dashboard fullscreen view mode to take effect (classses being applied)
setTimeout(() => {
// then recalc style
ctrl.calculatePanelHeight();
// then wait another cycle (this might not be needed)
$timeout(() => {
ctrl.render();
resizeScrollableContent();
});
});
});
// set initial height // set initial height
ctrl.calculatePanelHeight(); ctrl.calculatePanelHeight();

Loading…
Cancel
Save