diff options
author | Asaad Mahmood <Unknowngi@live.com> | 2015-08-14 19:36:58 +0500 |
---|---|---|
committer | Asaad Mahmood <Unknowngi@live.com> | 2015-08-14 19:36:58 +0500 |
commit | 67dc6e60f3e49ce1780b4bfccd57e62ccdc3902f (patch) | |
tree | abc129d29fbf34a282d726cfd10db93cfb283c63 /web/react/components | |
parent | b9aef9f2a6b90663cb7ba4ff9e42560c145b631d (diff) | |
download | chat-67dc6e60f3e49ce1780b4bfccd57e62ccdc3902f.tar.gz chat-67dc6e60f3e49ce1780b4bfccd57e62ccdc3902f.tar.bz2 chat-67dc6e60f3e49ce1780b4bfccd57e62ccdc3902f.zip |
mm-1858 - Truncating and adding tooltips to file names in thumbnail details
Diffstat (limited to 'web/react/components')
-rw-r--r-- | web/react/components/file_attachment.jsx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/web/react/components/file_attachment.jsx b/web/react/components/file_attachment.jsx index b7ea5734f..de9e2a04b 100644 --- a/web/react/components/file_attachment.jsx +++ b/web/react/components/file_attachment.jsx @@ -113,6 +113,14 @@ module.exports = React.createClass({ fileSizeString = utils.fileSizeToString(this.state.fileSize); } + var filenameString = decodeURIComponent(utils.getFileName(filename)); + if(filenameString.length > 35){ + trimmedFilename = filenameString.substring(0, Math.min(35,filenameString.length)) + "..."; + } + else { + trimmedFilename = decodeURIComponent(utils.getFileName(filename));; + } + return ( <div className="post-image__column" key={filename}> <a className="post-image__thumbnail" href="#" onClick={this.props.handleImageClick} @@ -120,7 +128,7 @@ module.exports = React.createClass({ {thumbnail} </a> <div className="post-image__details"> - <div className="post-image__name">{decodeURIComponent(utils.getFileName(filename))}</div> + <div data-toggle="tooltip" title={decodeURIComponent(utils.getFileName(filename))} className="post-image__name">{trimmedFilename}</div> <div> <span className="post-image__type">{fileInfo.ext.toUpperCase()}</span> <span className="post-image__size">{fileSizeString}</span> |