Display thumbnails for files without file extensions
Этот коммит содержится в:
@@ -126,7 +126,7 @@ module.exports = React.createClass({
|
|||||||
} else if (i < Constants.MAX_DISPLAY_FILES) {
|
} else if (i < Constants.MAX_DISPLAY_FILES) {
|
||||||
postFiles.push(
|
postFiles.push(
|
||||||
<div className="post-image__column custom-file" key={fileInfo.name+i}>
|
<div className="post-image__column custom-file" key={fileInfo.name+i}>
|
||||||
<a href={fileInfo.path+"."+fileInfo.ext} download={fileInfo.name+"."+fileInfo.ext}>
|
<a href={fileInfo.path + (fileInfo.ext ? "." + fileInfo.ext : "")} download={fileInfo.name + (fileInfo.ext ? "." + fileInfo.ext : "")}>
|
||||||
<div className={"file-icon "+utils.getIconClassName(type)}/>
|
<div className={"file-icon "+utils.getIconClassName(type)}/>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -546,10 +546,13 @@ module.exports.getIconClassName = function(fileType) {
|
|||||||
|
|
||||||
module.exports.splitFileLocation = function(fileLocation) {
|
module.exports.splitFileLocation = function(fileLocation) {
|
||||||
var fileSplit = fileLocation.split('.');
|
var fileSplit = fileLocation.split('.');
|
||||||
if (fileSplit.length < 2) return {};
|
|
||||||
|
|
||||||
var ext = fileSplit[fileSplit.length-1];
|
var ext = "";
|
||||||
fileSplit.splice(fileSplit.length-1,1)
|
if (fileSplit.length > 1) {
|
||||||
|
ext = fileSplit[fileSplit.length - 1];
|
||||||
|
fileSplit.splice(fileSplit.length - 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
var filePath = fileSplit.join('.');
|
var filePath = fileSplit.join('.');
|
||||||
var filename = filePath.split('/')[filePath.split('/').length-1];
|
var filename = filePath.split('/')[filePath.split('/').length-1];
|
||||||
|
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user