mirror of
https://github.com/element-hq/element-web.git
synced 2024-12-04 22:00:42 +03:00
Call for update on window resize.
This commit is contained in:
parent
c340032bd1
commit
738b59fd42
1 changed files with 15 additions and 0 deletions
|
@ -24,6 +24,21 @@ export default class GenericElementContextMenu extends React.Component {
|
|||
element: PropTypes.element.isRequired,
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
this.resize = this.resize.bind(this);
|
||||
window.addEventListener("resize", this.resize.bind(this));
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
window.removeEventListener("resize", this.resize.bind(this));
|
||||
}
|
||||
|
||||
resize() {
|
||||
if (this.props.onResize) {
|
||||
this.props.onResize();
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
return <div>{ this.props.element }</div>;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue