Auto-embed gifs from .gif links

Этот коммит содержится в:
JoramWilander
2015-10-22 08:45:28 -04:00
родитель 02a6f6b2cd
Коммит d4f1f981a5
4 изменённых файлов: 72 добавлений и 5 удалений

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

@@ -42,6 +42,7 @@ export default class PostList extends React.Component {
this.deactivate = this.deactivate.bind(this);
this.handleResize = this.handleResize.bind(this);
this.resizePostList = this.resizePostList.bind(this);
this.updateScroll = this.updateScroll.bind(this);
const state = this.getStateFromStores(props.channelId);
state.numToDisplay = Constants.POST_CHUNK_SIZE;
@@ -205,9 +206,10 @@ export default class PostList extends React.Component {
this.scrollToBottom();
// there's a new post and
// it's by the user and not a comment
// it's by the user (and not from their webhook) and not a comment
} else if (isNewPost &&
userId === firstPost.user_id &&
!firstPost.props.from_webhook &&
!Utils.isComment(firstPost)) {
this.scrollToBottom(true);
@@ -237,6 +239,11 @@ export default class PostList extends React.Component {
this.deactivate();
}
}
updateScroll() {
if (!this.scrolled) {
this.scrollToBottom();
}
}
handleResize() {
this.setState({
windowHeight: Utils.windowHeight()
@@ -550,6 +557,7 @@ export default class PostList extends React.Component {
posts={posts}
hideProfilePic={hideProfilePic}
isLastComment={isLastComment}
resize={this.updateScroll}
/>
);