From 73bed3880f3232f0eb9805e1ef91d7b3a2c97252 Mon Sep 17 00:00:00 2001 From: bergquist Date: Mon, 8 Feb 2016 09:49:53 +0100 Subject: [PATCH] feat(graph): sets fixed height for right side legend closes #1277 --- public/app/plugins/panel/graph/legend.js | 8 ++++++++ public/less/panel_graph.less | 5 +++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/public/app/plugins/panel/graph/legend.js b/public/app/plugins/panel/graph/legend.js index a1777772c98..a09bbbb6cb1 100644 --- a/public/app/plugins/panel/graph/legend.js +++ b/public/app/plugins/panel/graph/legend.js @@ -90,6 +90,14 @@ function (angular, _, $) { } function render() { + if (panel.legend.rightSide) { + var panelheight = scope.ctrl.height || scope.ctrl.panel.height || scope.ctrl.row.height; + $container.css("height", panelheight); + $container.toggleClass('graph-legend-fixed-height', true); + } else { + $container.css("height", ""); + } + if (firstRender) { elem.append($container); $container.on('click', '.graph-legend-icon', openColorSelector); diff --git a/public/less/panel_graph.less b/public/less/panel_graph.less index a0350d5d16c..36e96d67441 100644 --- a/public/less/panel_graph.less +++ b/public/less/panel_graph.less @@ -60,7 +60,6 @@ } .graph-legend-table { - display: table; width: 100%; margin: 0; @@ -272,4 +271,6 @@ font-size: 12px; } - +.graph-legend-fixed-height { + overflow-y: scroll; +}