Этот коммит содержится в:
JoramWilander
2015-09-11 08:38:18 -04:00
родитель 27e8b28672
Коммит 83931da9f2
2 изменённых файлов: 10 добавлений и 4 удалений

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

@@ -152,7 +152,7 @@ export default class Post extends React.Component {
return (
<div>
<div
id={post.id}
id={'post_' + post.id}
className={'post ' + sameUserClass + ' ' + rootUser + ' ' + postType + ' ' + currentUserCss}
>
{profilePic}

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

@@ -189,9 +189,15 @@ export default class PostList extends React.Component {
this.scrollToBottom(true);
// the user clicked 'load more messages'
} else if (this.gotMorePosts) {
var lastPost = oldPosts[oldOrder[prevState.numToDisplay]];
$('#' + lastPost.id)[0].scrollIntoView();
} else if (this.gotMorePosts && oldOrder.length > 0) {
let index;
if (prevState.numToDisplay >= oldOrder.length) {
index = oldOrder.length - 1;
} else {
index = prevState.numToDisplay;
}
const lastPost = oldPosts[oldOrder[index]];
$('#post_' + lastPost.id)[0].scrollIntoView();
this.gotMorePosts = false;
} else {
this.scrollTo(this.prevScrollTop);