diff options
author | Christopher Speller <crspeller@gmail.com> | 2016-03-17 12:09:04 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2016-03-17 12:09:04 -0400 |
commit | d383ed2f8dfc320c090b67d9f2e2d111710ca3cf (patch) | |
tree | 4051092e6838f0564af8a7e2116aefbceb1409d1 /webapp/components/view_image.jsx | |
parent | 2cd006474ec8a808b2ea2b0502a842f44cb0b127 (diff) | |
parent | 529513606b74fce60cbb066b381b27fbb6ea9d52 (diff) | |
download | chat-d383ed2f8dfc320c090b67d9f2e2d111710ca3cf.tar.gz chat-d383ed2f8dfc320c090b67d9f2e2d111710ca3cf.tar.bz2 chat-d383ed2f8dfc320c090b67d9f2e2d111710ca3cf.zip |
Merge pull request #2380 from rodrigocorsi2/code_preview
Created component CodePreview
Diffstat (limited to 'webapp/components/view_image.jsx')
-rw-r--r-- | webapp/components/view_image.jsx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/webapp/components/view_image.jsx b/webapp/components/view_image.jsx index 2b7e03382..7572f88ae 100644 --- a/webapp/components/view_image.jsx +++ b/webapp/components/view_image.jsx @@ -7,6 +7,7 @@ import * as Client from 'utils/client.jsx'; import * as Utils from 'utils/utils.jsx'; import AudioVideoPreview from './audio_video_preview.jsx'; import Constants from 'utils/constants.jsx'; +import CodePreview from './code_preview.jsx'; import FileInfoPreview from './file_info_preview.jsx'; import FileStore from 'stores/file_store.jsx'; import ViewImagePopoverBar from './view_image_popover_bar.jsx'; @@ -254,6 +255,15 @@ class ViewImageModal extends React.Component { formatMessage={this.props.intl.formatMessage} /> ); + } else if (CodePreview.support(filename)) { + content = ( + <CodePreview + filename={filename} + fileUrl={fileUrl} + fileInfo={fileInfo} + formatMessage={this.props.intl.formatMessage} + /> + ); } else { content = ( <FileInfoPreview @@ -323,6 +333,7 @@ class ViewImageModal extends React.Component { onClick={this.props.onModalDismissed} > <div + className='modal-back' onMouseEnter={this.onMouseEnterImage} onMouseLeave={this.onMouseLeaveImage} onClick={(e) => e.stopPropagation()} |