Create a way to restore last state of the rhs panel.

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
pull/21833/head
Michael Telatynski 2017-04-24 22:00:59 +01:00
parent ee560a969a
commit 4cf9e0c1ae
1 changed files with 9 additions and 0 deletions

View File

@ -303,6 +303,7 @@ module.exports = React.createClass({
componentDidUpdate: function() {
if (this.focusComposer) {
console.log('is this the shitty duplicate?');
dis.dispatch({action: 'focus_composer'});
this.focusComposer = false;
}
@ -547,15 +548,23 @@ module.exports = React.createClass({
});
break;
case 'hide_right_panel':
this.was_rhs_collapsed = this.state.collapse_rhs;
this.setState({
collapse_rhs: true,
});
break;
case 'show_right_panel':
this.was_rhs_collapsed = this.state.collapse_rhs;
this.setState({
collapse_rhs: false,
});
break;
// sets the panel to its state before last show/hide event
case 'restore_right_panel':
this.setState({
collapse_rhs: this.was_rhs_collapsed,
});
break;
case 'ui_opacity':
this.setState({
sideOpacity: payload.sideOpacity,