Этот коммит содержится в:
hmhealey
2015-11-17 16:10:16 -05:00
родитель 3d572be2f3
Коммит 70de0125ab
8 изменённых файлов: 37 добавлений и 59 удалений

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

@@ -2,7 +2,7 @@
// See License.txt for license information.
const ConfirmModal = require('../confirm_modal.jsx');
const Modal = require('../modal.jsx');
const Modal = ReactBootstrap.Modal;
const SettingsSidebar = require('../settings_sidebar.jsx');
const UserSettings = require('./user_settings.jsx');
@@ -34,6 +34,18 @@ export default class UserSettingsModal extends React.Component {
this.requireConfirm = false;
}
componentDidMount() {
if (this.props.show) {
this.handleShow();
}
}
componentDidUpdate(prevProps) {
if (this.props.show && !prevProps.show) {
this.handleShow();
}
}
handleShow() {
$(ReactDOM.findDOMNode(this.refs.modalBody)).css('max-height', $(window).height() - 300);
if ($(window).width() > 768) {
@@ -175,7 +187,6 @@ export default class UserSettingsModal extends React.Component {
<Modal
dialogClassName='settings-modal'
show={this.props.show}
onShow={this.handleShow}
onHide={this.handleHide}
onExited={this.handleHidden}
enforceFocus={this.state.enforceFocus}