Added a confirmation dialog for unsaved theme changes and removed unnecessary dialog close handling

Этот коммит содержится в:
hmhealey
2015-10-30 16:33:51 -04:00
родитель 738568e5a9
Коммит e56d21a920
10 изменённых файлов: 106 добавлений и 118 удалений

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

@@ -32,7 +32,6 @@ export default class UserSettingsGeneralTab extends React.Component {
this.updatePicture = this.updatePicture.bind(this);
this.updateSection = this.updateSection.bind(this);
this.handleClose = this.handleClose.bind(this);
this.setupInitialState = this.setupInitialState.bind(this);
this.state = this.setupInitialState(props);
@@ -210,20 +209,6 @@ export default class UserSettingsGeneralTab extends React.Component {
this.submitActive = false;
this.props.updateSection(section);
}
handleClose() {
$(ReactDOM.findDOMNode(this)).find('.form-control').each(function clearForms() {
this.value = '';
});
this.setState(assign({}, this.setupInitialState(this.props), {clientError: null, serverError: null, emailError: null}));
this.props.updateSection('');
}
componentDidMount() {
$('#user_settings').on('hidden.bs.modal', this.handleClose);
}
componentWillUnmount() {
$('#user_settings').off('hidden.bs.modal', this.handleClose);
}
setupInitialState(props) {
var user = props.user;