access history and activity log closing re-opens user settings in correct state

Этот коммит содержится в:
nickago
2015-08-07 09:41:14 -07:00
родитель 4c7cdb20f0
Коммит e01cae5c09
3 изменённых файлов: 13 добавлений и 5 удалений

Просмотреть файл

@@ -21,6 +21,7 @@ module.exports = React.createClass({
var self = this; var self = this;
$(this.refs.modal.getDOMNode()).on('hidden.bs.modal', function(e) { $(this.refs.modal.getDOMNode()).on('hidden.bs.modal', function(e) {
$('#user_settings1').modal('show');
self.setState({moreInfo: []}); self.setState({moreInfo: []});
}); });
}, },

Просмотреть файл

@@ -37,6 +37,7 @@ module.exports = React.createClass({
var self = this; var self = this;
$(this.refs.modal.getDOMNode()).on('hidden.bs.modal', function(e) { $(this.refs.modal.getDOMNode()).on('hidden.bs.modal', function(e) {
$('#user_settings1').modal('show');
self.setState({ moreInfo: [] }); self.setState({ moreInfo: [] });
}); });
}, },

Просмотреть файл

@@ -513,17 +513,23 @@ var SecurityTab = React.createClass({
this.setState({confirmPassword: e.target.value}); this.setState({confirmPassword: e.target.value});
}, },
handleHistoryOpen: function() { handleHistoryOpen: function() {
$('#user_settings1').modal('hide'); this.setState({willReturn: true});
$("#user_settings1").modal('hide');
}, },
handleDevicesOpen: function() { handleDevicesOpen: function() {
$('#user_settings1').modal('hide'); this.setState({willReturn: true});
$("#user_settings1").modal('hide');
}, },
handleClose: function() { handleClose: function() {
$(this.getDOMNode()).find('.form-control').each(function() { $(this.getDOMNode()).find('.form-control').each(function() {
this.value = ''; this.value = '';
}); });
this.setState({currentPassword: '', newPassword: '', confirmPassword: '', serverError: null, passwordError: null});
this.props.updateTab('general'); if (!this.state.willReturn) {
this.props.updateTab('general');
}
this.setState({current_password: '', new_password: '', confirm_password: '', server_error: null, password_error: null, willReturn: false});
}, },
componentDidMount: function() { componentDidMount: function() {
$('#user_settings1').on('hidden.bs.modal', this.handleClose); $('#user_settings1').on('hidden.bs.modal', this.handleClose);
@@ -533,7 +539,7 @@ var SecurityTab = React.createClass({
this.props.updateSection(''); this.props.updateSection('');
}, },
getInitialState: function() { getInitialState: function() {
return {currentPassword: '', newPassword: '', confirmPassword: ''}; return { current_password: '', new_password: '', confirm_password: '', willReturn: false };
}, },
render: function() { render: function() {
var serverError = this.state.serverError ? this.state.serverError : null; var serverError = this.state.serverError ? this.state.serverError : null;