1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-06 09:21:54 +00:00
This commit is contained in:
Michael An
2019-02-27 17:34:39 +08:00
committed by Daniel Pan
parent abd5718931
commit e28f6361d0
5 changed files with 52 additions and 1 deletions

View File

@@ -7,6 +7,8 @@ import Delete from '../../components/dialog/delete-dialog';
import Rename from '../../components/dialog/rename-dialog';
import CreateFolder from '../../components/dialog/create-folder-dialog';
import CreateFile from '../../components/dialog/create-file-dialog';
import { siteRoot } from '../../utils/constants';
import { Utils } from '../../utils/utils';
const propTypes = {
currentPath: PropTypes.string.isRequired,
@@ -21,6 +23,7 @@ const propTypes = {
onDeleteNode: PropTypes.func.isRequired,
onAddFileNode: PropTypes.func.isRequired,
onAddFolderNode: PropTypes.func.isRequired,
repoID: PropTypes.string.isRequired,
};
class DirColumnNav extends React.Component {
@@ -61,6 +64,9 @@ class DirColumnNav extends React.Component {
case 'Delete':
this.onDeleteToggle();
break;
case 'Open in New Tab':
this.onOpenFile(node);
break;
}
}
@@ -118,6 +124,11 @@ class DirColumnNav extends React.Component {
this.props.onDeleteNode(node);
}
onOpenFile = (node) => {
let newUrl = siteRoot + 'lib/' + this.props.repoID + '/file' + Utils.encodePath(node.path);
window.open(newUrl, '_blank');
}
checkDuplicatedName = (newName) => {
let node = this.state.opNode;
// root node to new node conditions: parentNode is null,