Fix separator visualization by propagating header height (#4437)

This commit is contained in:
Jay Lindquist
2018-02-15 19:48:57 -06:00
committed by Maxime Beauchemin
parent d6f1024d99
commit 0c87e23877
3 changed files with 22 additions and 3 deletions

View File

@@ -73,16 +73,21 @@ class GridCell extends React.PureComponent {
height(slice) {
const widgetHeight = this.props.widgetHeight;
const headerId = this.getHeaderId(slice);
const headerHeight = this.headerHeight(slice);
const descriptionId = this.getDescriptionId(slice);
const headerHeight = this.refs[headerId] ? this.refs[headerId].offsetHeight : 30;
let descriptionHeight = 0;
if (this.props.isExpanded && this.refs[descriptionId]) {
descriptionHeight = this.refs[descriptionId].offsetHeight + 10;
}
return widgetHeight - headerHeight - descriptionHeight;
}
headerHeight(slice) {
const headerId = this.getHeaderId(slice);
return this.refs[headerId] ? this.refs[headerId].offsetHeight : 30;
}
render() {
const {
isExpanded, isLoading, isCached, cachedDttm,
@@ -130,6 +135,7 @@ class GridCell extends React.PureComponent {
chartKey={chartKey}
datasource={datasource}
formData={formData}
headerHeight={this.headerHeight(slice)}
height={this.height(slice)}
width={this.width()}
timeout={timeout}