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.
Этот коммит содержится в:
VeraLyu
2017-06-17 01:12:22 +08:00
коммит произвёл Harrison Healey
родитель 617c6e0b23
Коммит 5158d3a446
6 изменённых файлов: 91 добавлений и 33 удалений

Просмотреть файл

@@ -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;