The toggle setting is now independent of the "minimize to tray" setting

This commit is contained in:
Martin Gondermann 2016-06-30 18:03:31 +02:00
parent 7c09ddda85
commit 0f6688b4cf

View file

@ -117,27 +117,14 @@ var SettingsPage = React.createClass({
});
},
handleChangeMinimizeToTray: function() {
var isChecked = this.refs.minimizeToTray.getChecked();
this.setState({
minimizeToTray: isChecked
minimizeToTray: this.refs.minimizeToTray.getChecked()
});
if (!isChecked) {
this.setState({
toggleWindowOnTrayIconClick: false
});
}
},
handleChangeToggleWindowOnTrayIconClick: function() {
if (this.refs.minimizeToTray.getChecked()) {
this.setState({
toggleWindowOnTrayIconClick: this.refs.toggleWindowOnTrayIconClick.getChecked()
});
} else {
this.setState({
toggleWindowOnTrayIconClick: false
});
}
this.setState({
toggleWindowOnTrayIconClick: this.refs.toggleWindowOnTrayIconClick.getChecked()
});
},
toggleShowTeamForm: function() {
this.setState({
@ -186,7 +173,7 @@ var SettingsPage = React.createClass({
options.push(<Input key="inputMinimizeToTray" id="inputMinimizeToTray" ref="minimizeToTray" type="checkbox" label="Leave app running in notification area when the window is closed"
checked={ this.state.minimizeToTray } onChange={ this.handleChangeMinimizeToTray } />);
options.push(<Input key="inputToggleWindowOnTrayIconClick" id="inputToggleWindowOnTrayIconClick" ref="toggleWindowOnTrayIconClick" type="checkbox" label="Toggle window visibility when clicking on the tray icon."
disabled={ !this.state.minimizeToTray } checked={ this.state.toggleWindowOnTrayIconClick } onChange={ this.handleChangeToggleWindowOnTrayIconClick } />);
checked={ this.state.toggleWindowOnTrayIconClick } onChange={ this.handleChangeToggleWindowOnTrayIconClick } />);
}
var options_row = (options.length > 0) ? (
<Row>