From 5158d3a44671f6faf2474b812987a7d301db7a2d Mon Sep 17 00:00:00 2001
From: VeraLyu <lvroyce0210@gmail.com>
Date: Sat, 17 Jun 2017 01:12:22 +0800
Subject: Remove fake img preview before loaded (#5854)

Remove fake img preview and collapse toggle before it is loaded,
only show img and toggle after it is fully loaded.
Fix markdown img size and add scroll down behaviour.
---
 webapp/components/youtube_video.jsx | 26 ++++++++++++++++++--------
 1 file changed, 18 insertions(+), 8 deletions(-)

(limited to 'webapp/components/youtube_video.jsx')

diff --git a/webapp/components/youtube_video.jsx b/webapp/components/youtube_video.jsx
index 0127fcb88..49f490bda 100644
--- a/webapp/components/youtube_video.jsx
+++ b/webapp/components/youtube_video.jsx
@@ -156,7 +156,13 @@ export default class YoutubeVideo extends React.Component {
 
     render() {
         if (!this.state.loaded) {
-            return <div className='video-loading'/>;
+            return (
+                <div
+                    className='post__embed-container'
+                >
+                    <div className='video-loading'/>
+                </div>
+            );
         }
 
         let header;
@@ -217,13 +223,17 @@ export default class YoutubeVideo extends React.Component {
         }
 
         return (
-            <div>
-                {header}
-                <div
-                    className='video-div embed-responsive-item'
-                    onClick={this.play}
-                >
-                    {content}
+            <div
+                className='post__embed-container'
+            >
+                <div>
+                    {header}
+                    <div
+                        className='video-div embed-responsive-item'
+                        onClick={this.play}
+                    >
+                        {content}
+                    </div>
                 </div>
             </div>
         );
-- 
cgit v1.2.3-1-g7c22

