|
|
@@ -16,6 +16,7 @@ module.directive('graphLegend', function(popoverSrv, $timeout) {
|
|
|
var i;
|
|
|
var legendScrollbar;
|
|
|
const legendRightDefaultWidth = 10;
|
|
|
+ let legendElem = elem.parent();
|
|
|
|
|
|
scope.$on('$destroy', function() {
|
|
|
destroyScrollbar();
|
|
|
@@ -110,7 +111,7 @@ module.directive('graphLegend', function(popoverSrv, $timeout) {
|
|
|
}
|
|
|
|
|
|
function render() {
|
|
|
- let legendWidth = elem.width();
|
|
|
+ let legendWidth = legendElem.width();
|
|
|
if (!ctrl.panel.legend.show) {
|
|
|
elem.empty();
|
|
|
firstRender = true;
|
|
|
@@ -132,8 +133,8 @@ module.directive('graphLegend', function(popoverSrv, $timeout) {
|
|
|
// Set width so it works with IE11
|
|
|
var width: any = panel.legend.rightSide && panel.legend.sideWidth ? panel.legend.sideWidth + 'px' : '';
|
|
|
var ieWidth: any = panel.legend.rightSide && panel.legend.sideWidth ? panel.legend.sideWidth - 1 + 'px' : '';
|
|
|
- elem.css('min-width', width);
|
|
|
- elem.css('width', ieWidth);
|
|
|
+ legendElem.css('min-width', width);
|
|
|
+ legendElem.css('width', ieWidth);
|
|
|
|
|
|
elem.toggleClass('graph-legend-table', panel.legend.alignAsTable === true);
|
|
|
|