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

Merge pull request #3595 from haiwen/repaire_click_root

Repaire click root
This commit is contained in:
Daniel Pan
2019-05-31 13:52:03 +08:00
committed by GitHub
4 changed files with 9 additions and 8 deletions

View File

@@ -67,12 +67,6 @@ class CopyDirent extends React.Component {
return;
}
// copy dirents to current path
if (selectedPath && selectedPath === this.props.path && repo.repo_id === repoID) {
this.setState({errMessage: message});
return;
}
// copy dirents to one of their child. eg: A/B, A/D -> A/B/C
let copyDirentPath = '';
let isChildPath = direntPaths.some(direntPath => {

View File

@@ -96,7 +96,8 @@ class MoveDirent extends React.Component {
}
moveItem = () => {
let { repo, repoID, selectedPath } = this.state;
let { repoID } = this.props;
let { repo, selectedPath } = this.state;
let direntPath = Utils.joinPath(this.props.path, this.props.dirent.name);
let message = gettext('Invalid destination path');

View File

@@ -130,7 +130,7 @@ class RepoListItem extends React.Component {
}
onRepoItemClick = () => {
if (!this.isCurrentRepo()) {
if (!this.isCurrentRepo() || this.props.selectedPath !== '') {
this.props.onRepoItemClick(this.props.repo);
} else {
this.onToggleClick();

View File

@@ -576,6 +576,9 @@ class LibContentView extends React.Component {
this.copyTreeNode(direntPath, destDirentPath, destRepo, names[index]);
});
}
if (destDirentPath === this.state.path) {
this.loadDirentList(this.state.path);
}
let message = Utils.getCopySuccessfulMessage(dirNames);
toaster.success(message);
}).catch(() => {
@@ -872,6 +875,9 @@ class LibContentView extends React.Component {
if (this.state.currentMode === 'column') {
this.copyTreeNode(direntPath, copyToDirentPath, destRepo, nodeName);
}
if (copyToDirentPath === nodeParentPath) {
this.loadDirentList(this.state.path);
}
let message = gettext('Successfully copied %(name)s.');
message = message.replace('%(name)s', dirName);
toaster.success(message);