mirror of
https://github.com/element-hq/element-web.git
synced 2024-12-05 05:38:41 +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,
|
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() {
|
render() {
|
||||||
return <div>{ this.props.element }</div>;
|
return <div>{ this.props.element }</div>;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue