Explorar el Código

dashlist: scroll fix when no header

The first item in the dashlist has a margin that messes up
the height calculation for the scroll bar when the Show headings
option is not selected. This fix adds a margin-top set to 0 for
the 1st item in the list in this case. This prevents a scrollbar
being shown incorrectly. Fixes #10772
Daniel Lee hace 7 años
padre
commit
5d756707ab

+ 1 - 1
public/app/plugins/panel/dashlist/module.html

@@ -4,7 +4,7 @@
       {{group.header}}
     </h6>
     <div class="dashlist-item" ng-repeat="dash in group.list">
-      <a class="dashlist-link dashlist-link-{{dash.type}}" href="{{dash.url}}">
+      <a class="dashlist-link dashlist-link-{{dash.type}}" ng-class="{'dashlist-link--no-section-header ':$first && !ctrl.panel.headings}" href="{{dash.url}}">
         <span class="dashlist-title">
           {{dash.title}}
         </span>

+ 4 - 0
public/sass/components/_panel_dashlist.scss

@@ -21,4 +21,8 @@
   .fa-star {
     color: $orange;
   }
+
+  &--no-margintop {
+    margin-top: 0;
+  }
 }