mirror of
https://github.com/element-hq/element-web
synced 2024-11-28 04:21:57 +03:00
Bind function in constructor.
This commit is contained in:
parent
85fca9dee8
commit
e36d972d94
1 changed files with 7 additions and 2 deletions
|
@ -24,13 +24,18 @@ export default class GenericElementContextMenu extends React.Component {
|
|||
element: PropTypes.element.isRequired,
|
||||
};
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.resize = this.resize.bind(this);
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.resize = this.resize.bind(this);
|
||||
window.addEventListener("resize", this.resize.bind(this));
|
||||
window.addEventListener("resize", this.resize);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
window.removeEventListener("resize", this.resize.bind(this));
|
||||
window.removeEventListener("resize", this.resize);
|
||||
}
|
||||
|
||||
resize() {
|
||||
|
|
Loading…
Reference in a new issue