summaryrefslogtreecommitdiffstats
path: root/webapp/components/user_settings
diff options
context:
space:
mode:
authorAsaad Mahmood <asaad@spinpunch.com>2016-03-23 04:06:08 +0500
committerAsaad Mahmood <asaad@spinpunch.com>2016-03-23 18:16:41 +0500
commite60f6f3b137839ed603a1b5d45cf658b6570ff91 (patch)
treedc50cde2a5e5c5732eab5cd11b9d219ce9444f5d /webapp/components/user_settings
parent18b8ae5298f50161ffa55b6d8576a5438fe0091a (diff)
downloadchat-e60f6f3b137839ed603a1b5d45cf658b6570ff91.tar.gz
chat-e60f6f3b137839ed603a1b5d45cf658b6570ff91.tar.bz2
chat-e60f6f3b137839ed603a1b5d45cf658b6570ff91.zip
Multiple UI improvements
Diffstat (limited to 'webapp/components/user_settings')
-rw-r--r--webapp/components/user_settings/user_settings_modal.jsx22
1 files changed, 7 insertions, 15 deletions
diff --git a/webapp/components/user_settings/user_settings_modal.jsx b/webapp/components/user_settings/user_settings_modal.jsx
index bd1df6ea5..d1c1f0fe2 100644
--- a/webapp/components/user_settings/user_settings_modal.jsx
+++ b/webapp/components/user_settings/user_settings_modal.jsx
@@ -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) {