Commit 4f38d237 by Daniel Lee

legend: small refactoring

parent 49168263
......@@ -15,6 +15,7 @@ module.directive('graphLegend', function(popoverSrv, $timeout) {
var seriesList;
var i;
var legendScrollbar;
const legendRightDefaultWidth = 10;
scope.$on('$destroy', function() {
if (legendScrollbar) {
......@@ -164,7 +165,7 @@ module.directive('graphLegend', function(popoverSrv, $timeout) {
}
// render first time for getting proper legend height
if (!panel.legend.rightSide || (panel.legend.rightSide && legendWidth !== 10)) {
if (!panel.legend.rightSide || (panel.legend.rightSide && legendWidth !== legendRightDefaultWidth)) {
renderLegendElement(tableHeaderElem);
elem.empty();
}
......@@ -241,7 +242,7 @@ module.directive('graphLegend', function(popoverSrv, $timeout) {
elem.append(seriesElements);
}
if (!panel.legend.rightSide || (panel.legend.rightSide && legendWidth !== 10)) {
if (!panel.legend.rightSide || (panel.legend.rightSide && legendWidth !== legendRightDefaultWidth)) {
addScrollbar();
} else {
destroyScrollbar();
......
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