[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:
Walter Rafelsberger 2019-01-22 14:34:16 +01:00 committed by GitHub
parent f1a02d19f9
commit ef85d1ee16
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);