summaryrefslogtreecommitdiffstats
path: root/webapp/components/markdown_image.jsx
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2017-06-28 10:30:02 -0400
committerChristopher Speller <crspeller@gmail.com>2017-06-28 07:30:02 -0700
commit2dea567dcfcdfcd016c0da55a120c6e854760fb0 (patch)
treeae718a1d36b8a6f48eb3684ff7b57c3b7b2eac6d /webapp/components/markdown_image.jsx
parent0f6992034229f542d823f73cf740002ad0ac48e3 (diff)
downloadchat-2dea567dcfcdfcd016c0da55a120c6e854760fb0.tar.gz
chat-2dea567dcfcdfcd016c0da55a120c6e854760fb0.tar.bz2
chat-2dea567dcfcdfcd016c0da55a120c6e854760fb0.zip
Added MarkdownImage component (#6774)
* Added MarkdownImage component * Fixed unit tests
Diffstat (limited to 'webapp/components/markdown_image.jsx')
-rw-r--r--webapp/components/markdown_image.jsx19
1 files changed, 19 insertions, 0 deletions
diff --git a/webapp/components/markdown_image.jsx b/webapp/components/markdown_image.jsx
new file mode 100644
index 000000000..75a6ce9ea
--- /dev/null
+++ b/webapp/components/markdown_image.jsx
@@ -0,0 +1,19 @@
+// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
+// See License.txt for license information.
+
+import React, {PureComponent} from 'react';
+
+import {postListScrollChange} from 'actions/global_actions.jsx';
+
+export default class MarkdownImage extends PureComponent {
+ handleLoad = () => {
+ postListScrollChange();
+ }
+
+ render() {
+ const props = {...this.props};
+ props.onLoad = this.handleLoad;
+
+ return <img {...props}/>;
+ }
+}