1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-09 02:42:47 +00:00

modify tag style

This commit is contained in:
shanshuirenjia
2018-12-17 18:43:18 +08:00
parent 0b9e5d3a1b
commit 163f92493c
3 changed files with 10 additions and 4 deletions

View File

@@ -377,6 +377,12 @@ class DirentListItem extends React.Component {
let { path, dirent } = this.props;
let direntPath = Utils.joinPath(path, dirent.name);
let href = siteRoot + 'wiki/lib/' + this.props.repoID + Utils.encodePath(direntPath);
let tagTitle = '';
if (dirent.file_tags) {
dirent.file_tags.forEach(item => {
tagTitle += item.name + ' ';
});
}
return (
<Fragment>
<tr className={this.state.highlight ? 'tr-highlight' : ''} onMouseEnter={this.onMouseEnter} onMouseOver={this.onMouseOver} onMouseLeave={this.onMouseLeave}>
@@ -400,11 +406,11 @@ class DirentListItem extends React.Component {
}
</td>
<td>
<div className="dirent-item tag-list tag-list-stacked ">
<div className="dirent-item tag-list tag-list-stacked" title={tagTitle}>
{ dirent.type !== 'dir' && dirent.file_tags.map((fileTag, index) => {
let length = dirent.file_tags.length;
return (
<span className={`file-tag bg-${fileTag.color}`} key={fileTag.id} title={fileTag.name} style={{zIndex: length - index }}></span>
<span className={`file-tag bg-${fileTag.color}`} key={fileTag.id} style={{zIndex: length - index }}></span>
);
})}
</div>