MM-1866 - Adding download icon and adding download link for both file title and download icon

Этот коммит содержится в:
Asaad Mahmood
2015-09-09 19:42:03 +05:00
родитель 12f3c877f1
Коммит f74f066a44
2 изменённых файлов: 24 добавлений и 4 удалений

Просмотреть файл

@@ -97,6 +97,7 @@ export default class FileAttachment extends React.Component {
var filename = this.props.filename;
var fileInfo = utils.splitFileLocation(filename);
var fileUrl = utils.getFileUrl(filename);
var type = utils.getFileType(fileInfo.ext);
var thumbnail;
@@ -150,14 +151,25 @@ export default class FileAttachment extends React.Component {
{thumbnail}
</a>
<div className='post-image__details'>
<div
<a
href={fileUrl}
download={filenameString}
data-toggle='tooltip'
title={filenameString}
className='post-image__name'
>
{trimmedFilename}
</div>
</a>
<div>
<a
href={fileUrl}
download={filenameString}
className='post-image__download'
>
<span
className='fa fa-download'
/>
</a>
<span className='post-image__type'>{fileInfo.ext.toUpperCase()}</span>
<span className='post-image__size'>{fileSizeString}</span>
</div>

Просмотреть файл

@@ -61,8 +61,8 @@
cursor: pointer;
z-index: 5;
opacity: inherit;
text-shadow: 0 0px 3px #444;
text-shadow: 0 0px 3px rgba(0, 0, 0, 0.7);
text-shadow: 0 0px 3px #444;
text-shadow: 0 0px 3px rgba(0, 0, 0, 0.7);
}
}
}
@@ -159,6 +159,14 @@
padding: 7px;
.post-image__name {
margin-bottom: 3px;
display: block;
color: #333;
}
.post-image__download {
display: inline-block;
padding-right: 7px;
cursor: pointer;
color: #555;
}
.post-image__type {
color: grey;