diff options
author | hmhealey <harrisonmhealey@gmail.com> | 2015-07-24 17:24:11 -0400 |
---|---|---|
committer | hmhealey <harrisonmhealey@gmail.com> | 2015-07-29 09:56:29 -0400 |
commit | 0e121a68de2d99ac17b27e41d92efae7721c6578 (patch) | |
tree | d77fa9c711bb78a7ea7dbd9257fe672fed508a16 /web/react | |
parent | b8a69f767c768d3ca0cebc73553a2b37e68e9347 (diff) | |
download | chat-0e121a68de2d99ac17b27e41d92efae7721c6578.tar.gz chat-0e121a68de2d99ac17b27e41d92efae7721c6578.tar.bz2 chat-0e121a68de2d99ac17b27e41d92efae7721c6578.zip |
Changed the thumbnail for non-image file attachments to open the ViewImageModal on click like it does for image attachments
Diffstat (limited to 'web/react')
-rw-r--r-- | web/react/components/file_attachment.jsx | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/web/react/components/file_attachment.jsx b/web/react/components/file_attachment.jsx index ad3e2ffb8..fd5adb8b4 100644 --- a/web/react/components/file_attachment.jsx +++ b/web/react/components/file_attachment.jsx @@ -83,18 +83,9 @@ module.exports = React.createClass({ var thumbnail; if (type === "image") { - thumbnail = ( - <a className="post-image__thumbnail" href="#" onClick={this.props.handleImageClick} - data-img-id={this.props.index} data-toggle="modal" data-target={"#" + this.props.modalId }> - <div ref={filename} className="post__load" style={{backgroundImage: 'url(/static/images/load.gif)'}}/> - </a> - ); + thumbnail = <div ref={filename} className="post__load" style={{backgroundImage: 'url(/static/images/load.gif)'}}/>; } else { - thumbnail = ( - <a href={fileInfo.path + (fileInfo.ext ? "." + fileInfo.ext : "")} download={fileInfo.name + (fileInfo.ext ? "." + fileInfo.ext : "")}> - <div className={"file-icon "+utils.getIconClassName(type)}/> - </a> - ); + thumbnail = <div className={"file-icon "+utils.getIconClassName(type)}/>; } if (!this.state.fileSize) { @@ -108,7 +99,10 @@ module.exports = React.createClass({ return ( <div className="post-image__column" key={filename}> - {thumbnail} + <a className="post-image__thumbnail" href="#" onClick={this.props.handleImageClick} + data-img-id={this.props.index} data-toggle="modal" data-target={"#" + this.props.modalId }> + {thumbnail} + </a> <div className="post-image__details"> <div className="post-image__name">{fileInfo.name}</div> <div> |