summaryrefslogtreecommitdiffstats
path: root/webapp/components/user_settings
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2016-03-23 16:02:36 -0400
committerJoram Wilander <jwawilander@gmail.com>2016-03-23 16:02:36 -0400
commit6ccef5caf5ff33b765bd488d4f609c4426c7bbf0 (patch)
treea3dc95120cd5113917bb4ec5acab716d645d4d3a /webapp/components/user_settings
parent7af2e6f87a754312809aa044edd062930616401a (diff)
parente60f6f3b137839ed603a1b5d45cf658b6570ff91 (diff)
downloadchat-6ccef5caf5ff33b765bd488d4f609c4426c7bbf0.tar.gz
chat-6ccef5caf5ff33b765bd488d4f609c4426c7bbf0.tar.bz2
chat-6ccef5caf5ff33b765bd488d4f609c4426c7bbf0.zip
Merge pull request #2509 from asaadmahmoodspin/ui-improvements
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) {