scrollable panels: fix initial content size (#9960)

This commit is contained in:
Alexander Zobnin
2017-11-22 09:05:33 +03:00
committed by Torkel Ödegaard
parent 830c307bba
commit 18ca7a53aa
2 changed files with 23 additions and 2 deletions

View File

@@ -65,6 +65,7 @@ module.directive('grafanaPanel', function($rootScope, $document) {
var cornerInfoElem = elem.find('.panel-info-corner');
var ctrl = scope.ctrl;
var infoDrop;
var panelScrollbar;
// the reason for handling these classes this way is for performance
// limit the watchers on panels etc
@@ -90,13 +91,24 @@ module.directive('grafanaPanel', function($rootScope, $document) {
if (ctrl.__proto__.constructor.scrollable) {
panelContent.addClass('panel-content--scrollable');
var myScrollbar = new GeminiScrollbar({
panelScrollbar = new GeminiScrollbar({
autoshow: false,
element: panelContent[0]
}).create();
}
}
function setPanelHeight() {
panelContent.height(ctrl.height);
if (panelScrollbar) {
panelScrollbar.update();
}
}
if (ctrl.__proto__.constructor.scrollable) {
ctrl.$scope.setPanelHeight = setPanelHeight;
}
// set initial transparency
if (ctrl.panel.transparent) {
transparentLastState = true;