From 22efdbe6fb897ea1b4b2cf52c66eb3037474fcf5 Mon Sep 17 00:00:00 2001 From: Saturnino Abril Date: Mon, 21 Aug 2017 20:06:34 +0800 Subject: fix expand/collapse arrows for youtube videos (#7240) --- .../post_view/post_attachment_opengraph/post_attachment_opengraph.jsx | 2 +- webapp/components/post_view/post_body_additional_content.jsx | 1 + webapp/components/youtube_video/youtube_video.jsx | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/webapp/components/post_view/post_attachment_opengraph/post_attachment_opengraph.jsx b/webapp/components/post_view/post_attachment_opengraph/post_attachment_opengraph.jsx index 04738fdcc..729084637 100644 --- a/webapp/components/post_view/post_attachment_opengraph/post_attachment_opengraph.jsx +++ b/webapp/components/post_view/post_attachment_opengraph/post_attachment_opengraph.jsx @@ -107,7 +107,7 @@ export default class PostAttachmentOpenGraph extends React.PureComponent { } componentDidUpdate() { - postListScrollChange(); + setTimeout(postListScrollChange, 0); } fetchData(url) { diff --git a/webapp/components/post_view/post_body_additional_content.jsx b/webapp/components/post_view/post_body_additional_content.jsx index bf01374fe..9310d951e 100644 --- a/webapp/components/post_view/post_body_additional_content.jsx +++ b/webapp/components/post_view/post_body_additional_content.jsx @@ -134,6 +134,7 @@ export default class PostBodyAdditionalContent extends React.PureComponent { channelId={this.props.post.channel_id} link={link} show={this.state.embedVisible} + onLinkLoaded={this.handleLinkLoaded} /> ); } diff --git a/webapp/components/youtube_video/youtube_video.jsx b/webapp/components/youtube_video/youtube_video.jsx index 34a0ed14c..c2bfa317c 100644 --- a/webapp/components/youtube_video/youtube_video.jsx +++ b/webapp/components/youtube_video/youtube_video.jsx @@ -14,7 +14,8 @@ export default class YoutubeVideo extends React.PureComponent { channelId: PropTypes.string.isRequired, currentChannelId: PropTypes.string.isRequired, link: PropTypes.string.isRequired, - show: PropTypes.bool.isRequired + show: PropTypes.bool.isRequired, + onLinkLoaded: PropTypes.func } constructor(props) { @@ -103,6 +104,7 @@ export default class YoutubeVideo extends React.PureComponent { } else { this.loadWithoutKey(); } + this.props.onLinkLoaded(); } loadWithoutKey() { -- cgit v1.2.3-1-g7c22