small screen legend right also work like legend under in render + set scrollbar to undefined in destroyScrollbar so it doesnt become disabled when toggeling between right and under

This commit is contained in:
Patrick O'Carroll 2018-03-22 14:39:13 +01:00
parent f2f709989f
commit 4916826364
2 changed files with 13 additions and 11 deletions

View File

@ -111,6 +111,7 @@ module.directive('graphLegend', function(popoverSrv, $timeout) {
}
function render() {
let legendWidth = elem.width();
if (!ctrl.panel.legend.show) {
elem.empty();
firstRender = true;
@ -163,7 +164,7 @@ module.directive('graphLegend', function(popoverSrv, $timeout) {
}
// render first time for getting proper legend height
if (!panel.legend.rightSide) {
if (!panel.legend.rightSide || (panel.legend.rightSide && legendWidth !== 10)) {
renderLegendElement(tableHeaderElem);
elem.empty();
}
@ -265,6 +266,7 @@ module.directive('graphLegend', function(popoverSrv, $timeout) {
function destroyScrollbar() {
if (legendScrollbar) {
legendScrollbar.destroy();
legendScrollbar = undefined;
}
}
},

View File

@ -11,19 +11,19 @@
flex: 0 1 10px;
max-height: 100%;
}
}
.graph-legend-series {
display: block;
padding-left: 0px;
}
.graph-legend-series {
display: block;
padding-left: 0px;
}
.graph-legend-table {
width: auto;
}
.graph-legend-table {
width: auto;
}
.graph-legend-table .graph-legend-series {
display: table-row;
.graph-legend-table .graph-legend-series {
display: table-row;
}
}
}
}