mirror of https://github.com/vector-im/riot-web
Fix collapsing of the left panel
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>pull/21833/head
parent
f113748520
commit
9c5af8b61e
|
@ -215,10 +215,12 @@ class LoggedInView extends React.Component<IProps, IState> {
|
||||||
|
|
||||||
_createResizer() {
|
_createResizer() {
|
||||||
let size;
|
let size;
|
||||||
|
let collapsed;
|
||||||
const collapseConfig: ICollapseConfig = {
|
const collapseConfig: ICollapseConfig = {
|
||||||
toggleSize: 260 - 50,
|
toggleSize: 260 - 50,
|
||||||
onCollapsed: (collapsed) => {
|
onCollapsed: (_collapsed) => {
|
||||||
if (collapsed) {
|
collapsed = _collapsed;
|
||||||
|
if (_collapsed) {
|
||||||
dis.dispatch({action: "hide_left_panel"}, true);
|
dis.dispatch({action: "hide_left_panel"}, true);
|
||||||
window.localStorage.setItem("mx_lhs_size", '0');
|
window.localStorage.setItem("mx_lhs_size", '0');
|
||||||
} else {
|
} else {
|
||||||
|
@ -233,7 +235,7 @@ class LoggedInView extends React.Component<IProps, IState> {
|
||||||
this.props.resizeNotifier.startResizing();
|
this.props.resizeNotifier.startResizing();
|
||||||
},
|
},
|
||||||
onResizeStop: () => {
|
onResizeStop: () => {
|
||||||
window.localStorage.setItem("mx_lhs_size", '' + size);
|
if (!collapsed) window.localStorage.setItem("mx_lhs_size", '' + size);
|
||||||
this.props.resizeNotifier.stopResizing();
|
this.props.resizeNotifier.stopResizing();
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue