1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-05 00:43:53 +00:00

abstract dir-operation-toolbar and view-mode-toolbar (#2569)

This commit is contained in:
杨顺强
2018-11-28 08:57:42 +08:00
committed by Daniel Pan
parent 0b022029e5
commit 330407be0b
17 changed files with 247 additions and 200 deletions

View File

@@ -126,11 +126,11 @@ class DirentListItem extends React.Component {
let filePath = this.getDirentPath(dirent);
if (dirent.starred) {
seafileAPI.unStarFile(repoID, filePath).then(() => {
this.props.updateDirent(this.props.dirent, "starred", false);
this.props.updateDirent(this.props.dirent, 'starred', false);
});
} else {
seafileAPI.starFile(repoID, filePath).then(() => {
this.props.updateDirent(this.props.dirent, "starred", true);
this.props.updateDirent(this.props.dirent, 'starred', true);
});
}
}
@@ -210,7 +210,7 @@ class DirentListItem extends React.Component {
}
if (newName.indexOf('/') > -1) {
let errMessage = 'Name should not include "/".';
let errMessage = 'Name should not include ' + '\'/\'' + '.';
Toast.error(gettext(errMessage));
return false;
}
@@ -249,8 +249,8 @@ class DirentListItem extends React.Component {
onLockItem = () => {
let filePath = this.getDirentPath(this.props.dirent);
seafileAPI.lockfile(repoID, filePath).then(() => {
this.props.updateDirent(this.props.dirent, "is_locked", true);
this.props.updateDirent(this.props.dirent, "locked_by_me", true);
this.props.updateDirent(this.props.dirent, 'is_locked', true);
this.props.updateDirent(this.props.dirent, 'locked_by_me', true);
});
this.onItemMenuHide();
}
@@ -258,8 +258,8 @@ class DirentListItem extends React.Component {
onUnlockItem = () => {
let filePath = this.getDirentPath(this.props.dirent);
seafileAPI.unlockfile(repoID, filePath).then(() => {
this.props.updateDirent(this.props.dirent, "is_locked", false);
this.props.updateDirent(this.props.dirent, "locked_by_me", false);
this.props.updateDirent(this.props.dirent, 'is_locked', false);
this.props.updateDirent(this.props.dirent, 'locked_by_me', false);
});
this.onItemMenuHide();
}