Skip to content

Commit

Permalink
Ensure docked windows which don't split top/bottombar are rendered wi…
Browse files Browse the repository at this point in the history
…thin the map area
  • Loading branch information
manisandro committed Oct 14, 2024
1 parent 6b6ad66 commit 5baeb4f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions components/ResizeableWindow.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class ResizeableWindow extends React.Component {
initialX: PropTypes.number,
initialY: PropTypes.number,
initiallyDocked: PropTypes.bool,
mapMargins: PropTypes.object,
maxHeight: PropTypes.number,
maxWidth: PropTypes.number,
maximizeable: PropTypes.bool,
Expand Down Expand Up @@ -258,11 +259,12 @@ class ResizeableWindow extends React.Component {
"resizeable-window-body-nonscrollable": !this.props.scrollable
});


const marginLeft = this.props.mapMargins.splitTopAndBottomBar && !splitTopAndBottomBar ? this.props.mapMargins.left : 0;
const marginRight = this.props.mapMargins.splitTopAndBottomBar && !splitTopAndBottomBar ? this.props.mapMargins.right : 0;
const containerStyle = {
display: this.props.visible ? 'initial' : 'none',
left: this.props.menuMargins.left + 'px',
right: this.props.menuMargins.right + 'px',
left: (marginLeft + this.props.menuMargins.left) + 'px',
right: (marginRight + this.props.menuMargins.right) + 'px',
top: splitTopAndBottomBar ? 0 : this.props.topbarHeight + 'px',
bottom: splitTopAndBottomBar ? 0 : this.props.bottombarHeight + 'px',
zIndex: splitTopAndBottomBar ? 110 : this.props.baseZIndex + this.props.windowStacking.findIndex(item => item === this.id)
Expand Down Expand Up @@ -479,6 +481,7 @@ export default connect((state) => ({
windowStacking: state.windows.stacking,
topbarHeight: state.map.topbarHeight,
bottombarHeight: state.map.bottombarHeight,
mapMargins: state.windows.mapMargins,
menuMargins: state.windows.menuMargins,
mobile: state.browser.mobile
}), {
Expand Down

0 comments on commit 5baeb4f

Please sign in to comment.