fixed issue with panel size when going into edit mode

This commit is contained in:
Torkel Ödegaard 2018-11-19 12:26:15 +01:00
parent 8130067fd1
commit d81d2f00f6
2 changed files with 14 additions and 1 deletions

View File

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

View File

@ -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
ctrl.calculatePanelHeight();