Skip to content

Commit

Permalink
Trigger window resize event on expand (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
anders-kiaer authored Aug 20, 2019
1 parent 2c842c9 commit d1efa28
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/lib/components/WebvizContainerPlaceholder.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default class WebvizContainerPlaceholder extends Component {
<WebvizToolbarButton icon={faCameraRetro} tooltip="Take screenshot" onClick={() => htmlToImage.toBlob(document.getElementById(this.props.id)).then(function (blob) {download_file('webviz-screenshot.png', blob, true)}) }/>
}
{ this.props.buttons.includes('expand') &&
<WebvizToolbarButton icon={faExpand} tooltip="Expand container" selected={this.state.expanded} onClick={() => this.setState({expanded: !this.state.expanded})} />
<WebvizToolbarButton icon={faExpand} tooltip="Expand container" selected={this.state.expanded} onClick={() => this.setState({expanded: !this.state.expanded}, () => {window.dispatchEvent(new Event('resize'))})} />
}
{ this.props.buttons.includes('download_zip') &&
<WebvizToolbarButton icon={faFileArchive} tooltip='Download data' onClick={() => this.props.setProps({data_requested: this.props.data_requested + 1})} />
Expand Down
Loading

0 comments on commit d1efa28

Please sign in to comment.