瀏覽代碼

Add baron scrollbar to a node managed by gafana (#11850)

* Add baron scroller to grafana panel, not plugin panel

* remove comment about root <div> element, since it will not be true
Ryan McKinley 7 年之前
父節點
當前提交
34133671b9
共有 2 個文件被更改,包括 4 次插入4 次删除
  1. 0 2
      docs/sources/plugins/developing/panels.md
  2. 4 2
      public/app/features/panel/panel_directive.ts

+ 0 - 2
docs/sources/plugins/developing/panels.md

@@ -25,8 +25,6 @@ export class MyPanelCtrl extends PanelCtrl {
   ...
 ```
 
-In this case, make sure the template has a single `<div>...</div>` root.  The plugin loader will modifiy that element adding a scrollbar.
-
 
 
 ### Examples

+ 4 - 2
public/app/features/panel/panel_directive.ts

@@ -21,7 +21,9 @@ var panelTemplate = `
     </div>
 
     <div class="panel-content">
-      <ng-transclude class="panel-height-helper"></ng-transclude>
+      <div class="panel-height-helper">
+        <div><ng-transclude ></ng-transclude></div>
+      </div>
     </div>
   </div>
 
@@ -113,7 +115,7 @@ module.directive('grafanaPanel', function($rootScope, $document, $timeout) {
           `;
 
           let scrollRoot = panelContent;
-          let scroller = panelContent.find(':first').find(':first');
+          let scroller = panelContent.find(':first');
 
           scrollRoot.addClass(scrollRootClass);
           $(scrollBarHTML).appendTo(scrollRoot);