mirror of
https://github.com/grafana/grafana.git
synced 2024-11-29 20:24:18 -06:00
Merge branch 'v4.3.x'
This commit is contained in:
commit
95a4ec8bf2
@ -122,18 +122,6 @@ export function grafanaAppDirective(playlistSrv, contextSrv) {
|
||||
body.toggleClass('page-kiosk-mode');
|
||||
});
|
||||
|
||||
var ticking = false;
|
||||
window.addEventListener('scroll', function(e) {
|
||||
if (!ticking) {
|
||||
ticking = true;
|
||||
setTimeout(function() {
|
||||
appEvents.emit('scroll');
|
||||
ticking = false;
|
||||
}, 100);
|
||||
}
|
||||
ticking = true;
|
||||
});
|
||||
|
||||
// handle in active view state class
|
||||
var lastActivity = new Date().getTime();
|
||||
var activeUser = true;
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -186,23 +186,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();
|
||||
}
|
||||
};
|
||||
|
||||
appEvents.on('scroll', refreshOnScroll, scope);
|
||||
|
||||
scope.$on('$destroy', function() {
|
||||
elem.off();
|
||||
cornerInfoElem.off();
|
||||
$document.off('scroll', refreshOnScroll);
|
||||
|
||||
if (infoDrop) {
|
||||
infoDrop.destroy();
|
||||
|
Loading…
Reference in New Issue
Block a user