mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-07 18:03:48 +00:00
repair dir&file link bug (#2741)
This commit is contained in:
@@ -395,7 +395,8 @@ class DirentListItem extends React.Component {
|
|||||||
render() {
|
render() {
|
||||||
let { path, dirent } = this.props;
|
let { path, dirent } = this.props;
|
||||||
let direntPath = Utils.joinPath(path, dirent.name);
|
let direntPath = Utils.joinPath(path, dirent.name);
|
||||||
let href = siteRoot + 'wiki/lib/' + this.props.repoID + Utils.encodePath(direntPath);
|
let dirHref = siteRoot + 'library/' + this.props.repoID + '/' + this.props.currentRepoInfo.repo_name + Utils.encodePath(direntPath);
|
||||||
|
let fileHref = siteRoot + 'lib/' + this.props.repoID + '/file' + Utils.encodePath(direntPath);
|
||||||
let toolTipID = MD5(dirent.name).slice(0, 7);
|
let toolTipID = MD5(dirent.name).slice(0, 7);
|
||||||
let tagTitle = '';
|
let tagTitle = '';
|
||||||
if (dirent.file_tags && dirent.file_tags.length > 0) {
|
if (dirent.file_tags && dirent.file_tags.length > 0) {
|
||||||
@@ -422,7 +423,7 @@ class DirentListItem extends React.Component {
|
|||||||
<td className="name">
|
<td className="name">
|
||||||
{this.state.isRenameing ?
|
{this.state.isRenameing ?
|
||||||
<DirentRename dirent={dirent} onRenameConfirm={this.onRenameConfirm} onRenameCancel={this.onRenameCancel}/> :
|
<DirentRename dirent={dirent} onRenameConfirm={this.onRenameConfirm} onRenameCancel={this.onRenameCancel}/> :
|
||||||
<a href={href} onClick={this.onItemClick}>{dirent.name}</a>
|
<a href={dirent.type === 'dir' ? dirHref : fileHref} onClick={this.onItemClick}>{dirent.name}</a>
|
||||||
}
|
}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
@@ -152,7 +152,12 @@ class Item extends Component {
|
|||||||
return (
|
return (
|
||||||
<tr onMouseOver={this.handleMouseOver} onMouseOut={this.handleMouseOut}>
|
<tr onMouseOver={this.handleMouseOver} onMouseOut={this.handleMouseOut}>
|
||||||
<td><img src={iconUrl} width="24" /></td>
|
<td><img src={iconUrl} width="24" /></td>
|
||||||
<td><Link to={linkUrl}>{item.obj_name}</Link></td>
|
<td>
|
||||||
|
{item.is_dir ?
|
||||||
|
<Link to={linkUrl}>{item.obj_name}</Link> :
|
||||||
|
<a href={linkUrl} target="_blank">{item.obj_name}</a>
|
||||||
|
}
|
||||||
|
</td>
|
||||||
<td><Link to={`${siteRoot}library/${item.repo_id}/${item.repo_name}/`}>{item.repo_name}</Link></td>
|
<td><Link to={`${siteRoot}library/${item.repo_id}/${item.repo_name}/`}>{item.repo_name}</Link></td>
|
||||||
<td>{item.view_cnt}</td>
|
<td>{item.view_cnt}</td>
|
||||||
<td>{this.renderExpriedData()}</td>
|
<td>{this.renderExpriedData()}</td>
|
||||||
|
Reference in New Issue
Block a user