summaryrefslogtreecommitdiffstats
path: root/web/react/components
diff options
context:
space:
mode:
authornickago <ngonella@calpoly.edu>2015-08-07 09:41:14 -0700
committernickago <ngonella@calpoly.edu>2015-08-11 13:33:08 -0700
commite01cae5c0965371efa8179abf10434d12dfd5843 (patch)
tree979c82f92058aac5dd06da1ec28e9ebb753ee265 /web/react/components
parent4c7cdb20f074e2c06a08cd64a57060b8e8b64d2e (diff)
downloadchat-e01cae5c0965371efa8179abf10434d12dfd5843.tar.gz
chat-e01cae5c0965371efa8179abf10434d12dfd5843.tar.bz2
chat-e01cae5c0965371efa8179abf10434d12dfd5843.zip
access history and activity log closing re-opens user settings in correct state
Diffstat (limited to 'web/react/components')
-rw-r--r--web/react/components/access_history_modal.jsx1
-rw-r--r--web/react/components/activity_log_modal.jsx1
-rw-r--r--web/react/components/user_settings.jsx16
3 files changed, 13 insertions, 5 deletions
diff --git a/web/react/components/access_history_modal.jsx b/web/react/components/access_history_modal.jsx
index 16768a119..fecb11c7d 100644
--- a/web/react/components/access_history_modal.jsx
+++ b/web/react/components/access_history_modal.jsx
@@ -21,6 +21,7 @@ module.exports = React.createClass({
var self = this;
$(this.refs.modal.getDOMNode()).on('hidden.bs.modal', function(e) {
+ $('#user_settings1').modal('show');
self.setState({moreInfo: []});
});
},
diff --git a/web/react/components/activity_log_modal.jsx b/web/react/components/activity_log_modal.jsx
index f28f0d5f1..64f93ca71 100644
--- a/web/react/components/activity_log_modal.jsx
+++ b/web/react/components/activity_log_modal.jsx
@@ -37,6 +37,7 @@ module.exports = React.createClass({
var self = this;
$(this.refs.modal.getDOMNode()).on('hidden.bs.modal', function(e) {
+ $('#user_settings1').modal('show');
self.setState({ moreInfo: [] });
});
},
diff --git a/web/react/components/user_settings.jsx b/web/react/components/user_settings.jsx
index 1a0c313d3..d0ce23639 100644
--- a/web/react/components/user_settings.jsx
+++ b/web/react/components/user_settings.jsx
@@ -513,17 +513,23 @@ var SecurityTab = React.createClass({
this.setState({confirmPassword: e.target.value});
},
handleHistoryOpen: function() {
- $('#user_settings1').modal('hide');
+ this.setState({willReturn: true});
+ $("#user_settings1").modal('hide');
},
handleDevicesOpen: function() {
- $('#user_settings1').modal('hide');
+ this.setState({willReturn: true});
+ $("#user_settings1").modal('hide');
},
handleClose: function() {
$(this.getDOMNode()).find('.form-control').each(function() {
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() {
$('#user_settings1').on('hidden.bs.modal', this.handleClose);
@@ -533,7 +539,7 @@ var SecurityTab = React.createClass({
this.props.updateSection('');
},
getInitialState: function() {
- return {currentPassword: '', newPassword: '', confirmPassword: ''};
+ return { current_password: '', new_password: '', confirm_password: '', willReturn: false };
},
render: function() {
var serverError = this.state.serverError ? this.state.serverError : null;