FIxing scroll for more direct channels

Этот коммит содержится в:
Asaad Mahmood
2015-12-10 10:38:57 +05:00
родитель 66f90428e9
Коммит 6350b3e268
2 изменённых файлов: 19 добавлений и 14 удалений

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

@@ -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'

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

@@ -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 {