diff --git a/src/components/structures/GroupGridView.js b/src/components/structures/GroupGridView.js index ece4e5fa23..c8d5f59323 100644 --- a/src/components/structures/GroupGridView.js +++ b/src/components/structures/GroupGridView.js @@ -104,7 +104,7 @@ export default class RoomGridView extends React.Component { } return (
- +
{ roomStores.map((roomStore, i) => { if (roomStore) { diff --git a/src/components/structures/MainSplit.js b/src/components/structures/MainSplit.js index 0427130eea..aa27930ce0 100644 --- a/src/components/structures/MainSplit.js +++ b/src/components/structures/MainSplit.js @@ -71,14 +71,17 @@ export default class MainSplit extends React.Component { } componentDidUpdate(prevProps) { - const wasExpanded = !this.props.collapsedRhs && prevProps.collapsedRhs; - const wasCollapsed = this.props.collapsedRhs && !prevProps.collapsedRhs; - const wasPanelSet = this.props.panel && !prevProps.panel; - const wasPanelCleared = !this.props.panel && prevProps.panel; + const shouldAllowResizing = + !this.props.disableSizing && + !this.props.collapsedRhs && + this.props.panel; - if (wasExpanded || wasPanelSet) { + if (shouldAllowResizing && !this.resizer) { this._createResizer(); - } else if (wasCollapsed || wasPanelCleared) { + } else if (!shouldAllowResizing && this.resizer) { + if (this.props.disableSizing) { + this.resizer.clearItemSizes(); + } this.resizer.detach(); this.resizer = null; } diff --git a/src/resizer/resizer.js b/src/resizer/resizer.js index 0e113b3664..ff2120b341 100644 --- a/src/resizer/resizer.js +++ b/src/resizer/resizer.js @@ -43,6 +43,14 @@ export class Resizer { this._onMouseDown = this._onMouseDown.bind(this); } + clearItemSizes() { + const handles = this._getResizeHandles(); + handles.forEach((handle) => { + const {sizer, item} = this._createSizerAndDistributor(handle); + sizer.clearItemSize(item); + }); + } + setClassNames(classNames) { this.classNames = classNames; } @@ -134,7 +142,7 @@ export class Resizer { const distributor = new this.distributorCtor( sizer, item, id, this.distributorCfg, items, this.container); - return {sizer, distributor}; + return {sizer, distributor, item}; } _getResizableItems() { diff --git a/src/resizer/sizer.js b/src/resizer/sizer.js index 303214854b..0e2236814e 100644 --- a/src/resizer/sizer.js +++ b/src/resizer/sizer.js @@ -82,6 +82,14 @@ class Sizer { } } + clearItemSize(item, size) { + if (this.vertical) { + item.style.height = null; + } else { + item.style.width = null; + } + } + /** @param {MouseEvent} event the mouse event @return {number} the distance between the cursor and the edge of the container,