diff options
author | VeraLyu <lvroyce0210@gmail.com> | 2017-06-17 01:12:22 +0800 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2017-06-16 13:12:22 -0400 |
commit | 5158d3a44671f6faf2474b812987a7d301db7a2d (patch) | |
tree | 45011c36140e4f56fddce09ca59b1c1bb517a076 /webapp/utils/markdown.jsx | |
parent | 617c6e0b23af1ba84aaa531261e951c5ce53102e (diff) | |
download | chat-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/utils/markdown.jsx')
-rw-r--r-- | webapp/utils/markdown.jsx | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/webapp/utils/markdown.jsx b/webapp/utils/markdown.jsx index 0d9e977d7..f47c45d10 100644 --- a/webapp/utils/markdown.jsx +++ b/webapp/utils/markdown.jsx @@ -7,6 +7,8 @@ import * as SyntaxHighlighting from './syntax_highlighting.jsx'; import marked from 'marked'; import katex from 'katex'; +import ScrollStore from 'stores/scroll_store.jsx'; + function markdownImageLoaded(image) { if (image.hasAttribute('height') && image.attributes.height.value !== 'auto') { const maxHeight = parseInt(global.getComputedStyle(image).maxHeight, 10); @@ -20,6 +22,7 @@ function markdownImageLoaded(image) { } else { image.style.height = 'auto'; } + ScrollStore.emitPostScroll(); } global.markdownImageLoaded = markdownImageLoaded; |