From fa50df7f6b35de1214225d9cdb8cd4e20f96bcfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Eura=C5=A1?= Date: Thu, 23 Aug 2018 13:54:15 +0000 Subject: [PATCH] Remove window wrappers (#636) * Remove parent wrapper, add filtering out closed windows * Add the rest of window manager changes (vscode ignores whitespace) * Make prettier happy --- js/components/WindowManager.js | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/js/components/WindowManager.js b/js/components/WindowManager.js index 5a3cf397..a31e5816 100644 --- a/js/components/WindowManager.js +++ b/js/components/WindowManager.js @@ -183,26 +183,19 @@ class WindowManager extends React.Component { left: 0 }; - const parentStyle = { - position: "absolute", - width: 0, - height: 0, - top: 0, - left: 0 - }; - return ( -
- {this.props.windowsInfo.map(w => ( -
this.handleMouseDown(w.key, e)} - style={{ ...style, transform: `translate(${w.x}px, ${w.y}px)` }} - key={w.key} - > - {this.props.windows[w.key]} -
- ))} -
+ const windows = this.props.windowsInfo.filter( + w => this.props.windows[w.key] ); + + return windows.map(w => ( +
this.handleMouseDown(w.key, e)} + style={{ ...style, transform: `translate(${w.x}px, ${w.y}px)` }} + > + {this.props.windows[w.key]} +
+ )); } }