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/stores/scroll_store.jsx | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 webapp/stores/scroll_store.jsx

(limited to 'webapp/stores/scroll_store.jsx')

diff --git a/webapp/stores/scroll_store.jsx b/webapp/stores/scroll_store.jsx
new file mode 100644
index 000000000..03a5f4e08
--- /dev/null
+++ b/webapp/stores/scroll_store.jsx
@@ -0,0 +1,24 @@
+// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
+// See License.txt for license information.
+
+import EventEmitter from 'events';
+
+const UPDATE_POST_SCROLL_EVENT = 'update_post_scroll';
+
+class ScrollStoreClass extends EventEmitter {
+    emitPostScroll() {
+        this.emit(UPDATE_POST_SCROLL_EVENT);
+    }
+
+    addPostScrollListener(callback) {
+        this.on(UPDATE_POST_SCROLL_EVENT, callback);
+    }
+
+    removePostScrollLisener(callback) {
+        this.removeListener(UPDATE_POST_SCROLL_EVENT, callback);
+    }
+}
+
+var ScrollStore = new ScrollStoreClass();
+export default ScrollStore;
+
-- 
cgit v1.2.3-1-g7c22

