Этот коммит содержится в:
Asaad Mahmood
2016-03-23 04:06:08 +05:00
родитель 18b8ae5298
Коммит e60f6f3b13
19 изменённых файлов: 66 добавлений и 52 удалений

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

@@ -64,7 +64,6 @@ class UserSettingsModal extends React.Component {
constructor(props) {
super(props);
this.handleShow = this.handleShow.bind(this);
this.handleHide = this.handleHide.bind(this);
this.handleHidden = this.handleHidden.bind(this);
this.handleCollapse = this.handleCollapse.bind(this);
@@ -95,24 +94,13 @@ class UserSettingsModal extends React.Component {
}
componentDidMount() {
if (this.props.show) {
this.handleShow();
}
UserStore.addChangeListener(this.onUserChanged);
}
componentDidUpdate(prevProps) {
if (this.props.show && !prevProps.show) {
this.handleShow();
}
componentDidUpdate() {
UserStore.removeChangeListener(this.onUserChanged);
}
handleShow() {
if ($(window).width() > 768) {
$(ReactDOM.findDOMNode(this.refs.modalBody)).css('max-height', $(window).height() - 200);
} else {
$(ReactDOM.findDOMNode(this.refs.modalBody)).css('max-height', $(window).height() - 50);
if (!Utils.isMobile()) {
$('.settings-modal .modal-body').perfectScrollbar();
}
}
@@ -222,6 +210,10 @@ class UserSettingsModal extends React.Component {
active_section: ''
});
}
if (!Utils.isMobile()) {
$('.settings-modal .modal-body').scrollTop(0).perfectScrollbar('update');
}
}
updateSection(section, skipConfirm) {