1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-07 09:51:26 +00:00

modify a-simulate to a tag (#2581)

This commit is contained in:
杨顺强
2018-11-30 11:52:19 +08:00
committed by Daniel Pan
parent 20acecebe1
commit ef3a1407a3
5 changed files with 33 additions and 42 deletions

View File

@@ -26,18 +26,22 @@ class TreeDirList extends React.Component {
this.setState({highlight: false});
}
onMainNodeClick = () => {
onMainNodeClick = (e) => {
e.preventDefault();
this.props.onMainNodeClick(this.props.node);
}
render() {
let node = this.props.node;
let href = siteRoot + 'wikis' + node.path;
return (
<tr className={this.state.highlight ? 'tr-highlight' : ''} onMouseEnter={this.onMouseEnter} onMouseLeave={this.onMouseLeave}>
<td className="icon">
<img src={node.type === 'dir' ? siteRoot + 'media/img/folder-192.png' : siteRoot + 'media/img/file/192/txt.png'} alt='icon'></img>
</td>
<td className="name a-simulate" onClick={this.onMainNodeClick}>{node.name}</td>
<td className="name">
<a href={href} onClick={this.onMainNodeClick}>{node.name}</a>
</td>
<td>{node.size}</td>
<td title={node.last_update_time}>{node.last_update_time}</td>
</tr>