mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
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
This commit is contained in:
parent
f00cbc0aeb
commit
e6f251011f
@ -142,12 +142,18 @@ function (angular, _, config) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
module.directive('panelWidth', function() {
|
module.directive('panelWidth', function() {
|
||||||
|
var fullscreen = false;
|
||||||
|
|
||||||
return function(scope, element) {
|
return function(scope, element) {
|
||||||
function updateWidth() {
|
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) {
|
scope.onAppEvent('panel-fullscreen-enter', function(evt, info) {
|
||||||
|
fullscreen = true;
|
||||||
|
|
||||||
if (scope.panel.id !== info.panelId) {
|
if (scope.panel.id !== info.panelId) {
|
||||||
element.hide();
|
element.hide();
|
||||||
} else {
|
} else {
|
||||||
@ -156,14 +162,20 @@ function (angular, _, config) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
scope.onAppEvent('panel-fullscreen-exit', function(evt, info) {
|
scope.onAppEvent('panel-fullscreen-exit', function(evt, info) {
|
||||||
|
fullscreen = false;
|
||||||
|
|
||||||
if (scope.panel.id !== info.panelId) {
|
if (scope.panel.id !== info.panelId) {
|
||||||
element.show();
|
element.show();
|
||||||
} else {
|
|
||||||
updateWidth();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateWidth();
|
||||||
});
|
});
|
||||||
|
|
||||||
scope.$watch('panel.span', updateWidth);
|
scope.$watch('panel.span', updateWidth);
|
||||||
|
|
||||||
|
if (fullscreen) {
|
||||||
|
element.hide();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user