From 541b0011ac91608ce2fd3114a7ebeb927a5061b8 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Mon, 3 Dec 2018 10:43:35 +0100 Subject: [PATCH] actually persist right panel width on resize --- src/components/structures/MainSplit.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/structures/MainSplit.js b/src/components/structures/MainSplit.js index a55feb65e4..ea3a97e161 100644 --- a/src/components/structures/MainSplit.js +++ b/src/components/structures/MainSplit.js @@ -23,6 +23,11 @@ export default class MainSplit extends React.Component { constructor(props) { super(props); this._setResizeContainerRef = this._setResizeContainerRef.bind(this); + this._onResized = this._onResized.bind(this); + } + + _onResized(size) { + window.localStorage.setItem("mx_rhs_size", size); } _createResizer() { @@ -33,7 +38,9 @@ export default class MainSplit extends React.Component { }; const resizer = new Resizer( this.resizeContainer, - FixedDistributor); + FixedDistributor, + {onResized: this._onResized}, + ); resizer.setClassNames(classNames); const rhsSize = window.localStorage.getItem("mx_rhs_size"); if (rhsSize !== null) {