summaryrefslogtreecommitdiffstats
path: root/webapp/stores
diff options
context:
space:
mode:
authorVeraLyu <lvroyce0210@gmail.com>2017-06-17 01:12:22 +0800
committerHarrison Healey <harrisonmhealey@gmail.com>2017-06-16 13:12:22 -0400
commit5158d3a44671f6faf2474b812987a7d301db7a2d (patch)
tree45011c36140e4f56fddce09ca59b1c1bb517a076 /webapp/stores
parent617c6e0b23af1ba84aaa531261e951c5ce53102e (diff)
downloadchat-5158d3a44671f6faf2474b812987a7d301db7a2d.tar.gz
chat-5158d3a44671f6faf2474b812987a7d301db7a2d.tar.bz2
chat-5158d3a44671f6faf2474b812987a7d301db7a2d.zip
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.
Diffstat (limited to 'webapp/stores')
-rw-r--r--webapp/stores/scroll_store.jsx24
1 files changed, 24 insertions, 0 deletions
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;
+