mm-1858 - Truncating and adding tooltips to file names in thumbnail details

Этот коммит содержится в:
Asaad Mahmood
2015-08-14 19:36:58 +05:00
родитель b9aef9f2a6
Коммит 67dc6e60f3
2 изменённых файлов: 13 добавлений и 6 удалений

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

@@ -113,6 +113,14 @@ module.exports = React.createClass({
fileSizeString = utils.fileSizeToString(this.state.fileSize); 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 ( return (
<div className="post-image__column" key={filename}> <div className="post-image__column" key={filename}>
<a className="post-image__thumbnail" href="#" onClick={this.props.handleImageClick} <a className="post-image__thumbnail" href="#" onClick={this.props.handleImageClick}
@@ -120,7 +128,7 @@ module.exports = React.createClass({
{thumbnail} {thumbnail}
</a> </a>
<div className="post-image__details"> <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> <div>
<span className="post-image__type">{fileInfo.ext.toUpperCase()}</span> <span className="post-image__type">{fileInfo.ext.toUpperCase()}</span>
<span className="post-image__size">{fileSizeString}</span> <span className="post-image__size">{fileSizeString}</span>

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

@@ -115,7 +115,6 @@
height: 100px; height: 100px;
float: left; float: left;
margin: 5px 10px 5px 0; margin: 5px 10px 5px 0;
display: table;
border: 1px solid lightgrey; border: 1px solid lightgrey;
.post__load { .post__load {
height: 100%; height: 100%;
@@ -137,16 +136,16 @@
} }
} }
.post-image__thumbnail { .post-image__thumbnail {
display: table-cell; float: left;
vertical-align: top;
width: 50%; width: 50%;
height: 100%; height: 100%;
cursor: zoom-in; cursor: zoom-in;
cursor: -webkit-zoom-in; cursor: -webkit-zoom-in;
} }
.post-image__details { .post-image__details {
display: table-cell; float: left;
vertical-align: top; @include clearfix;
word-break: break-word;
width: 50%; width: 50%;
height: 100%; height: 100%;
background: white; background: white;