Skip to content

Commit

Permalink
fix duplicate chart title (elastic#11594)
Browse files Browse the repository at this point in the history
* fix duplicate chart title

* updating el to axisWrapperElement
  • Loading branch information
ppisljar committed May 10, 2017
1 parent 2e4aabd commit db64f11
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/ui/public/vislib/lib/layout/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,23 +71,23 @@ export function VislibLibLayoutLayoutProvider(Private) {
const position = axis.axisConfig.get('position');
const chartTitle = new ChartTitle(visConfig);

const el = $(this.el).find(`.axis-wrapper-${position}`);
const axisWrapperElement = $(this.el).find(`.axis-wrapper-${position}`);

el.css('visibility', 'hidden');
axisWrapperElement.css('visibility', 'hidden');
axis.render();
chartTitle.render();
const width = el.width();
const height = el.height();
const width = axisWrapperElement.width();
const height = axisWrapperElement.height();
axis.destroy();
el.find('.chart-title svg').remove();
el.css('visibility', '');
$(this.el).find('.chart-title svg').remove();
axisWrapperElement.css('visibility', '');


if (axis.axisConfig.isHorizontal()) {
const spacerNodes = $(this.el).find(`.y-axis-spacer-block-${position}`);
spacerNodes.height(`${height}px`);
} else {
el.find('.y-axis-div-wrapper').width(`${width}px`);
axisWrapperElement.find('.y-axis-div-wrapper').width(`${width}px`);
}
}

Expand Down

0 comments on commit db64f11

Please sign in to comment.