Skip to content

Commit 57d181a

Browse files
committed
Modified overlay behaviour to close only the last overlay
1 parent 18d92e2 commit 57d181a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

client/modules/App/components/Overlay.jsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,11 @@ class Overlay extends React.Component {
3333
return;
3434
}
3535

36-
this.handleClickOutside();
36+
this.handleClickOutside(e);
3737
}
3838

3939
handleClickOutside() {
40+
console.log(this.node);
4041
this.close();
4142
}
4243

@@ -49,6 +50,10 @@ class Overlay extends React.Component {
4950
}
5051

5152
close() {
53+
// Only close if it is the last (and therefore the topmost overlay)
54+
const overlays = document.getElementsByClassName('overlay');
55+
if (this.node.parentElement.parentElement !== overlays[overlays.length - 1]) return;
56+
5257
if (!this.props.closeOverlay) {
5358
browserHistory.push(this.props.previousPath);
5459
} else {

0 commit comments

Comments
 (0)