diff options
author | Harrison Healey <harrisonmhealey@gmail.com> | 2015-12-14 10:07:36 -0500 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2015-12-14 10:07:36 -0500 |
commit | f93922c14ff3c0d2c0b8f33e14e501a10d50a5f1 (patch) | |
tree | 4c52f49c4a0cbf87d9d59d13c4c22bbc61c9bb69 | |
parent | 398925014e7a2c2c0423d3d68434ca23a2fcc26a (diff) | |
parent | b0f841462924279320d50a9e73af5ce6878ea402 (diff) | |
download | chat-f93922c14ff3c0d2c0b8f33e14e501a10d50a5f1.tar.gz chat-f93922c14ff3c0d2c0b8f33e14e501a10d50a5f1.tar.bz2 chat-f93922c14ff3c0d2c0b8f33e14e501a10d50a5f1.zip |
Merge pull request #1697 from asaadmahmoodspin/master
FIxing scroll for more direct channels
-rw-r--r-- | web/react/components/more_direct_channels.jsx | 28 | ||||
-rw-r--r-- | web/sass-files/sass/partials/_modal.scss | 7 |
2 files changed, 21 insertions, 14 deletions
diff --git a/web/react/components/more_direct_channels.jsx b/web/react/components/more_direct_channels.jsx index cf40af6ae..3661b19e6 100644 --- a/web/react/components/more_direct_channels.jsx +++ b/web/react/components/more_direct_channels.jsx @@ -47,6 +47,21 @@ export default class MoreDirectChannels extends React.Component { UserStore.addChangeListener(this.handleUserChange); } + componentDidUpdate(prevProps) { + if (!prevProps.show && this.props.show) { + this.onShow(); + } + } + + onShow() { + if (Utils.isMobile()) { + $(ReactDOM.findDOMNode(this.refs.userList)).css('max-height', $(window).height() - 250); + } else { + $(ReactDOM.findDOMNode(this.refs.userList)).perfectScrollbar(); + $(ReactDOM.findDOMNode(this.refs.userList)).css('max-height', $(window).height() - 300); + } + } + handleFilterChange() { const filter = ReactDOM.findDOMNode(this.refs.filter).value; @@ -164,15 +179,6 @@ export default class MoreDirectChannels extends React.Component { ); } - componentDidUpdate(prevProps) { - if (!prevProps.show && this.props.show) { - $(ReactDOM.findDOMNode(this.refs.userList)).css('max-height', $(window).height() - 50); - if ($(window).width() > 768) { - $(ReactDOM.findDOMNode(this.refs.userList)).perfectScrollbar(); - } - } - } - render() { if (!this.props.show) { return null; @@ -217,8 +223,8 @@ export default class MoreDirectChannels extends React.Component { <Modal.Header closeButton={true}> <Modal.Title>{'Direct Messages'}</Modal.Title> </Modal.Header> - <Modal.Body> - <div className='row filter-row'> + <Modal.Body ref='modalBody'> + <div className='filter-row'> <div className='col-sm-6'> <input ref='filter' diff --git a/web/sass-files/sass/partials/_modal.scss b/web/sass-files/sass/partials/_modal.scss index a082ffb22..6f70e502f 100644 --- a/web/sass-files/sass/partials/_modal.scss +++ b/web/sass-files/sass/partials/_modal.scss @@ -381,9 +381,9 @@ .more-modal { .user-list { + overflow-y: auto; + overflow-x: hidden; margin-top: 10px; - overflow: auto; - -webkit-overflow-scrolling: touch; max-height: 500px; position: relative; } @@ -394,11 +394,12 @@ .modal-body { padding: 10px 0 20px; + overflow-x: hidden; } .filter-row { margin-top: 10px; - padding: 0 15px; + @include clearfix; } .member-count { |