Преглед изворни кода

small code cleanup in grafanaGraph

Torkel Ödegaard пре 11 година
родитељ
комит
5cd73cea4b
2 измењених фајлова са 10 додато и 2 уклоњено
  1. 9 1
      src/app/directives/grafanaGraph.js
  2. 1 1
      src/css/less/overrides.less

+ 9 - 1
src/app/directives/grafanaGraph.js

@@ -45,7 +45,15 @@ function (angular, $, kbn, moment, _) {
 
         function setElementHeight() {
           try {
-            elem.css({ height: scope.height || scope.panel.height || scope.row.height });
+            var height = scope.height || scope.panel.height || scope.row.height;
+            height = height.replace('px', '') - 32; // subtract panel title bar
+
+            if (scope.panel.legend.show) {
+              height = height - 35; // subtract one line legend
+            }
+
+            elem.css('height', height + 'px');
+
             return true;
           } catch(e) { // IE throws errors sometimes
             return false;

+ 1 - 1
src/css/less/overrides.less

@@ -77,7 +77,7 @@ code, pre {
 }
 
 .panel-content {
-  padding: 0px 10px 10px 10px;
+  padding: 0px 10px 0 10px;
 }
 
 .panel-title {