From 812958162a69b24dff14e8dbb30758b1597c4de4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Wed, 31 May 2017 10:47:04 +0200 Subject: [PATCH] revert: removed lazy loading feature, closes #8500 --- public/app/features/panel/panel_ctrl.ts | 9 --------- public/app/features/panel/panel_directive.ts | 14 -------------- 2 files changed, 23 deletions(-) diff --git a/public/app/features/panel/panel_ctrl.ts b/public/app/features/panel/panel_ctrl.ts index 8de78291baa..83c79f4123b 100644 --- a/public/app/features/panel/panel_ctrl.ts +++ b/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); } diff --git a/public/app/features/panel/panel_directive.ts b/public/app/features/panel/panel_directive.ts index 63fdba693cb..11906ab7d8d 100644 --- a/public/app/features/panel/panel_directive.ts +++ b/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();