From f74f066a4472ad5ceac379eb3518307b51a18280 Mon Sep 17 00:00:00 2001
From: Asaad Mahmood <Unknowngi@live.com>
Date: Wed, 9 Sep 2015 19:42:03 +0500
Subject: MM-1866 - Adding download icon and adding download link for both file
 title and download icon

---
 web/react/components/file_attachment.jsx | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

(limited to 'web/react/components/file_attachment.jsx')

diff --git a/web/react/components/file_attachment.jsx b/web/react/components/file_attachment.jsx
index 78693df98..c9aa06a97 100644
--- a/web/react/components/file_attachment.jsx
+++ b/web/react/components/file_attachment.jsx
@@ -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>
-- 
cgit v1.2.3-1-g7c22

