From 3a172e76584739651bef2f1fe9f9cad0f5d4fed7 Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Thu, 18 Jun 2015 14:40:11 -0400 Subject: fixes mm-1297 can now scroll through more than 5 images --- web/react/components/post_body.jsx | 16 +++++++++------- 1 file 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( -
-
-
- ); + if (i < Constants.MAX_DISPLAY_FILES) { + postFiles.push( +
+
+
+ ); + } images.push(filenames[i]); - } else { + } else if (i < Constants.MAX_DISPLAY_FILES) { postFiles.push(
-- cgit v1.2.3-1-g7c22