mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Only render tooltip if position is in viewport
This commit is contained in:
@@ -177,6 +177,11 @@ function ($, core) {
|
||||
}
|
||||
pos.pageX = elem.offset().left + pointOffset.left;
|
||||
pos.pageY = elem.offset().top + elem.height() * pos.panelRelY;
|
||||
var isVisible = pos.pageY >= $(window).scrollTop() && pos.pageY <= $(window).innerHeight() + $(window).scrollTop();
|
||||
if (!isVisible) {
|
||||
self.clear(plot);
|
||||
return;
|
||||
}
|
||||
plot.setCrosshair(pos);
|
||||
allSeriesMode = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user