Allow to open a modal for embedded photo (#5777)

This commit is contained in:
Akihiko Odaki authored and Eugen Rochko committed 2017-11-25 15:41:45 +01:00
1 parent 1266c66f79
commit bf7757cbbc
5 files changed
+41 -14

No files matched your search

@@ -7,7 +7,7 @@ export default class ImageLoader extends React.PureComponent {
static propTypes = {
alt: PropTypes.string,
src: PropTypes.string.isRequired,
previewSrc: PropTypes.string.isRequired,
previewSrc: PropTypes.string,
width: PropTypes.number,
height: PropTypes.number,
}
@@ -47,7 +47,7 @@ export default class ImageLoader extends React.PureComponent {
this.removeEventListeners();
this.setState({ loading: true, error: false });
Promise.all([
this.loadPreviewCanvas(props),
props.previewSrc && this.loadPreviewCanvas(props),
this.hasSize() && this.loadOriginalImage(props),
].filter(Boolean))
.then(() => {