From e6f251011fb9c7cf523ee822fb8019dace353abe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Fri, 20 May 2016 15:15:02 +0200 Subject: [PATCH] fix(panel span): fixed issue setting panel span while in fullscren and also an issue when changing repeat variable while in fullscreen view, fixes #4957 --- public/app/features/dashboard/rowCtrl.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/public/app/features/dashboard/rowCtrl.js b/public/app/features/dashboard/rowCtrl.js index 5607f1eecac..8ab1fcf88f8 100644 --- a/public/app/features/dashboard/rowCtrl.js +++ b/public/app/features/dashboard/rowCtrl.js @@ -142,12 +142,18 @@ function (angular, _, config) { }); module.directive('panelWidth', function() { + var fullscreen = false; + return function(scope, element) { function updateWidth() { - element[0].style.width = ((scope.panel.span / 1.2) * 10) + '%'; + if (!fullscreen) { + element[0].style.width = ((scope.panel.span / 1.2) * 10) + '%'; + } } scope.onAppEvent('panel-fullscreen-enter', function(evt, info) { + fullscreen = true; + if (scope.panel.id !== info.panelId) { element.hide(); } else { @@ -156,14 +162,20 @@ function (angular, _, config) { }); scope.onAppEvent('panel-fullscreen-exit', function(evt, info) { + fullscreen = false; + if (scope.panel.id !== info.panelId) { element.show(); - } else { - updateWidth(); } + + updateWidth(); }); scope.$watch('panel.span', updateWidth); + + if (fullscreen) { + element.hide(); + } }; });