provide collapsed callback to also collapse on react side of things

This commit is contained in:
Bruno Windels 2018-10-16 14:56:49 +02:00
parent 529845d8fc
commit c095e30ae4
2 changed files with 17 additions and 5 deletions

View file

@ -98,12 +98,17 @@ const LoggedInView = React.createClass({
vertical: "mx_ResizeHandle_vertical",
reverse: "mx_ResizeHandle_reverse"
};
const collapseToggleSize = 260 - 50;
const config = {
toggleSize: 260 - 50,
onCollapsed: (collapsed) => {
this.setState({collapseLhs: collapsed});
}
};
makeResizeable(
this.resizeContainer,
classNames,
CollapseDistributor,
collapseToggleSize);
config);
},
componentWillMount: function() {
@ -524,7 +529,7 @@ const LoggedInView = React.createClass({
<DragDropContext onDragEnd={this._onDragEnd}>
<div ref={(div) => this.resizeContainer = div} className={bodyClasses}>
<LeftPanel
collapsed={this.props.collapseLhs || false}
collapsed={this.props.collapseLhs || this.state.collapseLhs || false}
disabled={this.props.leftDisabled}
/>
<ResizeHandle/>