diff options
author | Reed Garmsen <rgarmsen2295@gmail.com> | 2015-06-18 12:23:02 -0700 |
---|---|---|
committer | Reed Garmsen <rgarmsen2295@gmail.com> | 2015-06-18 12:23:02 -0700 |
commit | 19e9a4121820a1ad124a4189837c8c4088c33439 (patch) | |
tree | 29fa0399d83a9b8849bd5eae4396fa6f620112da /web/react/components | |
parent | 9d582a5a7ad758a10f456d769f020ac0b7933c16 (diff) | |
parent | aee643e20c8e8350a1137aa69e164218fe5a33f1 (diff) | |
download | chat-19e9a4121820a1ad124a4189837c8c4088c33439.tar.gz chat-19e9a4121820a1ad124a4189837c8c4088c33439.tar.bz2 chat-19e9a4121820a1ad124a4189837c8c4088c33439.zip |
Merge pull request #11 from mattermost/master
to me
Diffstat (limited to 'web/react/components')
-rw-r--r-- | web/react/components/post_body.jsx | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/web/react/components/post_body.jsx b/web/react/components/post_body.jsx index 55fc32c33..3079917ec 100644 --- a/web/react/components/post_body.jsx +++ b/web/react/components/post_body.jsx @@ -85,20 +85,22 @@ module.exports = React.createClass({ var postFiles = []; var images = []; if (filenames) { - for (var i = 0; i < filenames.length && i < Constants.MAX_DISPLAY_FILES; i++) { + for (var i = 0; i < filenames.length; i++) { var fileInfo = utils.splitFileLocation(filenames[i]); if (Object.keys(fileInfo).length === 0) continue; var type = utils.getFileType(fileInfo.ext); if (type === "image") { - postFiles.push( - <div className="post-image__column" key={filenames[i]}> - <a href="#" onClick={this.handleImageClick} data-img-id={images.length.toString()} data-toggle="modal" data-target={"#" + postImageModalId }><div ref={filenames[i]} className="post__load" style={{backgroundImage: 'url(/static/images/load.gif)'}}></div></a> - </div> - ); + if (i < Constants.MAX_DISPLAY_FILES) { + postFiles.push( + <div className="post-image__column" key={filenames[i]}> + <a href="#" onClick={this.handleImageClick} data-img-id={images.length.toString()} data-toggle="modal" data-target={"#" + postImageModalId }><div ref={filenames[i]} className="post__load" style={{backgroundImage: 'url(/static/images/load.gif)'}}></div></a> + </div> + ); + } images.push(filenames[i]); - } else { + } else if (i < Constants.MAX_DISPLAY_FILES) { postFiles.push( <div className="post-image__column custom-file" key={fileInfo.name}> <a href={fileInfo.path+"."+fileInfo.ext} download={fileInfo.name+"."+fileInfo.ext}> |