From d81d2f00f65673f9cab8635d990460d3560277b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Mon, 19 Nov 2018 12:26:15 +0100 Subject: [PATCH] fixed issue with panel size when going into edit mode --- public/app/features/dashboard/panel_model.ts | 2 +- public/app/features/panel/panel_directive.ts | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/public/app/features/dashboard/panel_model.ts b/public/app/features/dashboard/panel_model.ts index ed032a118fe..dc8a509f2eb 100644 --- a/public/app/features/dashboard/panel_model.ts +++ b/public/app/features/dashboard/panel_model.ts @@ -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) { diff --git a/public/app/features/panel/panel_directive.ts b/public/app/features/panel/panel_directive.ts index aef7ca5e256..61c2be2adea 100644 --- a/public/app/features/panel/panel_directive.ts +++ b/public/app/features/panel/panel_directive.ts @@ -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();