Selaa lähdekoodia

ux: graph legend refactoring

Torkel Ödegaard 8 vuotta sitten
vanhempi
commit
4aad4a069c

+ 5 - 5
public/app/plugins/panel/graph/legend.ts

@@ -220,12 +220,12 @@ module.directive('graphLegend', function(popoverSrv, $timeout) {
           elem.append(tbodyElem);
           elem.append(tbodyElem);
         } else {
         } else {
           elem.append(seriesElements);
           elem.append(seriesElements);
-        }
 
 
-        if (!legendScrollbar) {
-          legendScrollbar = new PerfectScrollbar(elem[0]);
-        } else {
-          legendScrollbar.update();
+          if (!legendScrollbar) {
+            legendScrollbar = new PerfectScrollbar(elem[0]);
+          } else {
+            legendScrollbar.update();
+          }
         }
         }
       }
       }
     }
     }

+ 3 - 11
public/sass/components/_panel_graph.scss

@@ -6,17 +6,9 @@
   &--legend-right {
   &--legend-right {
     flex-direction: row;
     flex-direction: row;
 
 
-    // .graph-panel__chart {
-      //   display: table-cell;
-      //   width: 100%;
-      //   position: relative;
-    // }
-
     .graph-legend {
     .graph-legend {
+      flex: 0 1 10px;
       max-height: 100%;
       max-height: 100%;
-      position: relative;
-      left: 4px;
-      margin: 0 0 0 1rem;
     }
     }
 
 
     .graph-legend-series {
     .graph-legend-series {
@@ -51,12 +43,10 @@
 }
 }
 
 
 .graph-legend {
 .graph-legend {
-  @include clearfix();
   flex: 0 1 auto;
   flex: 0 1 auto;
   max-height: 30%;
   max-height: 30%;
   margin: 0 $spacer;
   margin: 0 $spacer;
   text-align: center;
   text-align: center;
-  width: calc(100% - $spacer);
   padding-top: 6px;
   padding-top: 6px;
   position: relative;
   position: relative;
 
 
@@ -121,7 +111,9 @@
     display: block;
     display: block;
     overflow-y: auto;
     overflow-y: auto;
     overflow-x: hidden;
     overflow-x: hidden;
+    height: 100%;
     padding-bottom: 1px;
     padding-bottom: 1px;
+    padding-right: 5px;
   }
   }
 
 
   .graph-legend-series {
   .graph-legend-series {