Просмотр исходного кода

remember scroll position (https://github.com/grafana/grafana/issues/7680) (#7728)

Patric Kanngießer 8 лет назад
Родитель
Сommit
3735a1ace7
1 измененных файлов с 2 добавлено и 0 удалено
  1. 2 0
      public/app/plugins/panel/graph/legend.js

+ 2 - 0
public/app/plugins/panel/graph/legend.js

@@ -65,7 +65,9 @@ function (angular, _, $) {
           var el = $(e.currentTarget);
           var index = getSeriesIndexForElement(el);
           var seriesInfo = seriesList[index];
+          var scrollPosition = $($container.children('tbody')).scrollTop();
           ctrl.toggleSeries(seriesInfo, e);
+          $($container.children('tbody')).scrollTop(scrollPosition);
         }
 
         function sortLegend(e) {