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() { componentDidUpdate: function() {
if (this.focusComposer) { if (this.focusComposer) {
console.log('is this the shitty duplicate?');
dis.dispatch({action: 'focus_composer'}); dis.dispatch({action: 'focus_composer'});
this.focusComposer = false; this.focusComposer = false;
} }
@ -547,15 +548,23 @@ module.exports = React.createClass({
}); });
break; break;
case 'hide_right_panel': case 'hide_right_panel':
this.was_rhs_collapsed = this.state.collapse_rhs;
this.setState({ this.setState({
collapse_rhs: true, collapse_rhs: true,
}); });
break; break;
case 'show_right_panel': case 'show_right_panel':
this.was_rhs_collapsed = this.state.collapse_rhs;
this.setState({ this.setState({
collapse_rhs: false, collapse_rhs: false,
}); });
break; 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': case 'ui_opacity':
this.setState({ this.setState({
sideOpacity: payload.sideOpacity, sideOpacity: payload.sideOpacity,