mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[ML] Fixes tooltip x position. (#29048)
Fixes a regression where the chart tooltip's x position would fail to be calculated because of a removed global class for the K7 design. This fixes it by falling back to 0 instead of NaN if the element is not present.
This commit is contained in:
parent
f1a02d19f9
commit
ef85d1ee16
1 changed files with 1 additions and 1 deletions
|
@ -32,7 +32,7 @@ mlChartTooltipService.show = function (contents, target, offset = { x: 0, y: 0 }
|
|||
this.element.html(contents);
|
||||
|
||||
// side bar width
|
||||
const navOffset = $('.kbnGlobalNav').width();
|
||||
const navOffset = $('.kbnGlobalNav').width() || 0;
|
||||
const contentWidth = $('body').width() - navOffset - 10;
|
||||
const tooltipWidth = this.element.width();
|
||||
const scrollTop = (window.pageYOffset || doc.scrollTop) - (doc.clientTop || 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue