Sfoglia il codice sorgente

revert: removed lazy loading feature, closes #8500

Torkel Ödegaard 8 anni fa
parent
commit
812958162a

+ 0 - 9
public/app/features/panel/panel_ctrl.ts

@@ -35,8 +35,6 @@ export class PanelCtrl {
   containerHeight: any;
   events: Emitter;
   timing: any;
-  skippedLastRefresh: boolean;
-  isPanelVisible: any;
 
   constructor($scope, $injector) {
     this.$injector = $injector;
@@ -77,13 +75,6 @@ export class PanelCtrl {
   }
 
   refresh() {
-    if (!this.isPanelVisible() && !this.dashboard.meta.soloMode && !this.dashboard.snapshot) {
-      this.skippedLastRefresh = true;
-      return;
-    }
-
-    this.skippedLastRefresh = false;
-
     this.events.emit('refresh', null);
   }
 

+ 0 - 14
public/app/features/panel/panel_directive.ts

@@ -185,23 +185,9 @@ module.directive('grafanaPanel', function($rootScope, $document) {
       elem.on('mouseenter', mouseEnter);
       elem.on('mouseleave', mouseLeave);
 
-      ctrl.isPanelVisible = function () {
-        var position = panelContainer[0].getBoundingClientRect();
-        return (0 < position.top) && (position.top < window.innerHeight);
-      };
-
-      const refreshOnScroll = function () {
-        if (ctrl.skippedLastRefresh) {
-          ctrl.refresh();
-        }
-      };
-
-      $document.on('scroll', refreshOnScroll);
-
       scope.$on('$destroy', function() {
         elem.off();
         cornerInfoElem.off();
-        $document.off('scroll', refreshOnScroll);
 
         if (infoDrop) {
           infoDrop.destroy();