diff options
author | Corey Hulen <corey@hulen.com> | 2015-06-18 10:58:37 -0800 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2015-06-18 10:58:37 -0800 |
commit | bcea40686ae138b24580cac3956cb9e1b3d6c953 (patch) | |
tree | 94ed482035292db7bbdbd4a4e369309d08970594 /web | |
parent | 27c29ed745a1730c579d49dc6d26da5ba88ea155 (diff) | |
parent | 19ec09391c49340e8bb661a029362fe7c727041a (diff) | |
download | chat-bcea40686ae138b24580cac3956cb9e1b3d6c953.tar.gz chat-bcea40686ae138b24580cac3956cb9e1b3d6c953.tar.bz2 chat-bcea40686ae138b24580cac3956cb9e1b3d6c953.zip |
Merge pull request #29 from mattermost/mm-1297
FOR HELIUM RELEASE fixes mm-1297 can now scroll through more than 5 images
Diffstat (limited to 'web')
-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}> |