mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-23 18:17:38 +00:00
Handle race condition with resize event
This commit is contained in:
parent
918420b68a
commit
fcb90bab8b
1 changed files with 8 additions and 1 deletions
|
|
@ -11,11 +11,18 @@ class WindowManager extends React.Component {
|
|||
super(props);
|
||||
this.windowNodes = [];
|
||||
this.state = {};
|
||||
window.addEventListener('resize', this.centerWindows.bind(this));
|
||||
this.getRef = this.getRef.bind(this);
|
||||
this.handleMouseDown = this.handleMouseDown.bind(this);
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
window.addEventListener('resize', this.centerWindows.bind(this));
|
||||
const {innerHeight, innerWidth} = window;
|
||||
if (innerHeight || innerWidth) {
|
||||
this.centerWindows();
|
||||
}
|
||||
}
|
||||
|
||||
centerWindows() {
|
||||
const {innerHeight, innerWidth} = window;
|
||||
const state = {};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue