diff --git a/frontend/src/components/cur-dir-path/dir-tool.js b/frontend/src/components/cur-dir-path/dir-tool.js
index 5718ba9baa..83c5e81258 100644
--- a/frontend/src/components/cur-dir-path/dir-tool.js
+++ b/frontend/src/components/cur-dir-path/dir-tool.js
@@ -86,74 +86,76 @@ class DirTool extends React.Component {
let name = Utils.getFileName(currentPath);
let trashUrl = siteRoot + 'repo/recycle/' + repoID + '/?referer=' + encodeURIComponent(location.href);
let historyUrl = siteRoot + 'repo/history/' + repoID + '/';
- if ( (name === repoName || name === '') && !isFile && permission) {
- return (
-
+ if (permission) {
+ if (isFile) { // isFile
+ historyUrl = siteRoot + 'repo/file_revisions/' + repoID + '/?p=' + Utils.encodePath(currentPath);
+ return (
-
- {this.state.isRepoTagDialogShow && (
-
-
- {this.state.isListRepoTagShow && (
-
- )}
-
- {this.state.isCreateRepoTagShow && (
-
- )}
-
- {this.state.isUpdateRepoTagShow && (
-
- )}
-
- {this.state.isListTaggedFileShow && (
-
- )}
-
-
- )}
-
- );
- } else if (!isFile && permission) {
- return (
-
- );
- } else if (permission) {
- historyUrl = siteRoot + 'repo/file_revisions/' + repoID + '/?p=' + Utils.encodePath(currentPath);
- return (
-
- );
+ );
+ } else {
+ if (name) { // name not '' is not root path
+ trashUrl = siteRoot + 'repo/recycle/' + repoID + '/?dir_path=' + Utils.encodePath(currentPath) + '/?referer=' + encodeURIComponent(location.href);
+ return (
+
+ );
+ } else { // currentPath === '/' is root path
+ return (
+
+
+
+ {this.state.isRepoTagDialogShow && (
+
+
+ {this.state.isListRepoTagShow && (
+
+ )}
+ {this.state.isCreateRepoTagShow && (
+
+ )}
+ {this.state.isUpdateRepoTagShow && (
+
+ )}
+ {this.state.isListTaggedFileShow && (
+
+ )}
+
+
+ )}
+
+ );
+ }
+ }
}
return '';
}