Skip to content

Commit e6f2510

Browse files
committed
fix(panel span): fixed issue setting panel span while in fullscren and also an issue when changing repeat variable while in fullscreen view, fixes grafana#4957
1 parent f00cbc0 commit e6f2510

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

public/app/features/dashboard/rowCtrl.js

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,18 @@ function (angular, _, config) {
142142
});
143143

144144
module.directive('panelWidth', function() {
145+
var fullscreen = false;
146+
145147
return function(scope, element) {
146148
function updateWidth() {
147-
element[0].style.width = ((scope.panel.span / 1.2) * 10) + '%';
149+
if (!fullscreen) {
150+
element[0].style.width = ((scope.panel.span / 1.2) * 10) + '%';
151+
}
148152
}
149153

150154
scope.onAppEvent('panel-fullscreen-enter', function(evt, info) {
155+
fullscreen = true;
156+
151157
if (scope.panel.id !== info.panelId) {
152158
element.hide();
153159
} else {
@@ -156,14 +162,20 @@ function (angular, _, config) {
156162
});
157163

158164
scope.onAppEvent('panel-fullscreen-exit', function(evt, info) {
165+
fullscreen = false;
166+
159167
if (scope.panel.id !== info.panelId) {
160168
element.show();
161-
} else {
162-
updateWidth();
163169
}
170+
171+
updateWidth();
164172
});
165173

166174
scope.$watch('panel.span', updateWidth);
175+
176+
if (fullscreen) {
177+
element.hide();
178+
}
167179
};
168180
});
169181

0 commit comments

Comments
 (0)