diff options
author | Asaad Mahmood <asaad@spinpunch.com> | 2015-12-10 10:38:57 +0500 |
---|---|---|
committer | Asaad Mahmood <asaad@spinpunch.com> | 2015-12-10 10:42:11 +0500 |
commit | 6350b3e268c009c3e318196c93ad4fb189c1e51d (patch) | |
tree | df3ae0ae895fd77dc2942ea3ab7b36439aff5158 /web | |
parent | 66f90428e9df63e1a863ff33a4d7b61166abccab (diff) | |
download | chat-6350b3e268c009c3e318196c93ad4fb189c1e51d.tar.gz chat-6350b3e268c009c3e318196c93ad4fb189c1e51d.tar.bz2 chat-6350b3e268c009c3e318196c93ad4fb189c1e51d.zip |
FIxing scroll for more direct channels
Diffstat (limited to 'web')
-rw-r--r-- | web/react/components/more_direct_channels.jsx | 28 | ||||
-rw-r--r-- | web/sass-files/sass/partials/_modal.scss | 5 |
2 files changed, 19 insertions, 14 deletions
diff --git a/web/react/components/more_direct_channels.jsx b/web/react/components/more_direct_channels.jsx index cf40af6ae..a65ce21d1 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 ($(window).width() > 768) { + $(ReactDOM.findDOMNode(this.refs.modalBody)).perfectScrollbar(); + $(ReactDOM.findDOMNode(this.refs.modalBody)).css('max-height', $(window).height() - 200); + } else { + $(ReactDOM.findDOMNode(this.refs.modalBody)).css('max-height', $(window).height() - 150); + } + } + 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..d533b4e9e 100644 --- a/web/sass-files/sass/partials/_modal.scss +++ b/web/sass-files/sass/partials/_modal.scss @@ -382,8 +382,6 @@ .user-list { margin-top: 10px; - overflow: auto; - -webkit-overflow-scrolling: touch; max-height: 500px; position: relative; } @@ -394,11 +392,12 @@ .modal-body { padding: 10px 0 20px; + overflow-x: hidden; } .filter-row { margin-top: 10px; - padding: 0 15px; + @include clearfix; } .member-count { |