diff --git a/frontend/src/components/cur-dir-path/dir-tool.js b/frontend/src/components/cur-dir-path/dir-tool.js index 03a918d409..0f2385297f 100644 --- a/frontend/src/components/cur-dir-path/dir-tool.js +++ b/frontend/src/components/cur-dir-path/dir-tool.js @@ -87,14 +87,7 @@ class DirTool extends React.Component { let trashUrl = siteRoot + 'repo/' + repoID + '/trash/'; let historyUrl = siteRoot + 'repo/history/' + repoID + '/'; if (permission) { - if (isFile) { // isFile - historyUrl = siteRoot + 'repo/file_revisions/' + repoID + '/?p=' + Utils.encodePath(currentPath); - return ( -
- ); - } else { + if (!isFile) { if (name) { // name not '' is not root path trashUrl = siteRoot + 'repo/' + repoID + '/trash/?path=' + encodeURIComponent(currentPath); return ( diff --git a/frontend/src/components/toolbar/view-file-toolbar.js b/frontend/src/components/toolbar/view-file-toolbar.js index 588d135b44..9c397bfe5e 100644 --- a/frontend/src/components/toolbar/view-file-toolbar.js +++ b/frontend/src/components/toolbar/view-file-toolbar.js @@ -85,6 +85,11 @@ class ViewFileToolbar extends React.Component { }); } + onHistoryClick = () => { + let historyUrl = siteRoot + 'repo/file_revisions/' + this.props.repoID + '/?p=' + Utils.encodePath(this.props.path); + location.href = historyUrl; + } + render() { let { filePermission } = this.props; let name = Utils.getFileName(this.props.path); @@ -114,6 +119,7 @@ class ViewFileToolbar extends React.Component { }