1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-02 07:47:32 +00:00

optimized code

This commit is contained in:
shanshuirenjia 2018-12-17 12:03:37 +08:00
parent 4cbc72819e
commit 98de027e98
3 changed files with 3 additions and 6 deletions

View File

@ -93,7 +93,6 @@ class SharedRepoListItem extends React.Component {
'permission': repo.permission
});
//todo change to library; div-view is not compatibility
let libPath = `${siteRoot}library/${repo.repo_id}/${Utils.encodePath(repo.repo_name)}/`;
return { iconUrl, iconTitle, libPath };
@ -135,17 +134,14 @@ class SharedRepoListItem extends React.Component {
}
onItemShare = () => {
// todo
this.setState({isShowSharedDialog: true});
}
onItemUnshare = () => {
// todo
this.props.onItemUnshare(this.props.repo);
}
onItemDelete = () => {
// todo
this.props.onItemDelete(this.props.repo);
}

View File

@ -191,6 +191,5 @@ const GroupsViewPropTypes = {
};
GroupsView.propTypes = GroupsViewPropTypes;
// Groups.propTypes = propTypes;
export default GroupsView;

View File

@ -147,7 +147,9 @@ export const Utils = {
return encodeURIComponent(e);
}).join('/');
*/
if (!path) {
return '';
}
var path_arr = path.split('/');
var path_arr_ = [];
for (var i = 0, len = path_arr.length; i < len; i++) {