Commit f91a833e by Torkel Ödegaard

fix(panel): set initial transparency state at first link

parent cbe8af96
...@@ -68,8 +68,8 @@ module.directive('grafanaPanel', function($rootScope) { ...@@ -68,8 +68,8 @@ module.directive('grafanaPanel', function($rootScope) {
// the reason for handling these classes this way is for performance // the reason for handling these classes this way is for performance
// limit the watchers on panels etc // limit the watchers on panels etc
var transparentLastState; var transparentLastState = false;
var lastHasAlertRule; var lastHasAlertRule = false;
var lastAlertState; var lastAlertState;
var hasAlertRule; var hasAlertRule;
var lastHeight = 0; var lastHeight = 0;
...@@ -91,6 +91,12 @@ module.directive('grafanaPanel', function($rootScope) { ...@@ -91,6 +91,12 @@ module.directive('grafanaPanel', function($rootScope) {
lastHeight = ctrl.containerHeight; lastHeight = ctrl.containerHeight;
} }
// set initial transparency
if (ctrl.panel.transparent) {
transparentLastState = true;
panelContainer.addClass('panel-transparent', true);
}
ctrl.events.on('render', () => { ctrl.events.on('render', () => {
if (lastHeight !== ctrl.containerHeight) { if (lastHeight !== ctrl.containerHeight) {
panelContainer.css({minHeight: ctrl.containerHeight}); panelContainer.css({minHeight: ctrl.containerHeight});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment