From 1842868410ff13b46053f363eb22595faf9d2e7c Mon Sep 17 00:00:00 2001 From: hmhealey Date: Mon, 27 Jul 2015 12:36:14 -0400 Subject: Display thumbnails for files without file extensions --- web/react/components/post_body.jsx | 2 +- web/react/utils/utils.jsx | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'web/react') diff --git a/web/react/components/post_body.jsx b/web/react/components/post_body.jsx index 7871f52b7..9f598ecb3 100644 --- a/web/react/components/post_body.jsx +++ b/web/react/components/post_body.jsx @@ -126,7 +126,7 @@ module.exports = React.createClass({ } else if (i < Constants.MAX_DISPLAY_FILES) { postFiles.push(
- +
diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx index 00580af6e..fbf1e0d4f 100644 --- a/web/react/utils/utils.jsx +++ b/web/react/utils/utils.jsx @@ -546,10 +546,13 @@ module.exports.getIconClassName = function(fileType) { module.exports.splitFileLocation = function(fileLocation) { var fileSplit = fileLocation.split('.'); - if (fileSplit.length < 2) return {}; - var ext = fileSplit[fileSplit.length-1]; - fileSplit.splice(fileSplit.length-1,1) + var ext = ""; + if (fileSplit.length > 1) { + ext = fileSplit[fileSplit.length - 1]; + fileSplit.splice(fileSplit.length - 1, 1); + } + var filePath = fileSplit.join('.'); var filename = filePath.split('/')[filePath.split('/').length-1]; -- cgit v1.2.3-1-g7c22