mirror of
https://github.com/haiwen/seahub.git
synced 2025-07-04 10:46:58 +00:00
Add split line (#3222)
This commit is contained in:
parent
243b6aedea
commit
9f958bcc2e
@ -56,23 +56,23 @@ class DirentRightMenu extends React.Component {
|
|||||||
let permission = dirent.permission ? dirent.permission : '';
|
let permission = dirent.permission ? dirent.permission : '';
|
||||||
let can_set_folder_perm = folderPermEnabled && ((isRepoOwner && currentRepoInfo.has_been_shared_out) || currentRepoInfo.is_admin);
|
let can_set_folder_perm = folderPermEnabled && ((isRepoOwner && currentRepoInfo.has_been_shared_out) || currentRepoInfo.is_admin);
|
||||||
if (type === 'dir' && permission === 'rw') {
|
if (type === 'dir' && permission === 'rw') {
|
||||||
let subscriptList = showShare ? ['Share', 'Download', 'Delete'] : ['Download', 'Delete'];
|
let subscriptList = showShare ? ['Share', 'Download', 'Delete', 'Divider'] : ['Download', 'Delete', 'Divider'];
|
||||||
let menuList = [];
|
let menuList = [];
|
||||||
if (can_set_folder_perm) {
|
if (can_set_folder_perm) {
|
||||||
menuList = [...subscriptList, 'Rename', 'Move', 'Copy', 'Permission', 'Details', 'Open via Client'];
|
menuList = [...subscriptList, 'Rename', 'Move', 'Copy', 'Divider', 'Permission', 'Details', 'Divider', 'Open via Client'];
|
||||||
} else {
|
} else {
|
||||||
menuList = [...subscriptList, 'Rename', 'Move', 'Copy', 'Details', 'Open via Client'];
|
menuList = [...subscriptList, 'Rename', 'Move', 'Copy', 'Divider', 'Details', 'Divider', 'Open via Client'];
|
||||||
}
|
}
|
||||||
return menuList;
|
return menuList;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type === 'dir' && permission === 'r') {
|
if (type === 'dir' && permission === 'r') {
|
||||||
let menuList = showShare ? ['Share', 'Download', 'Delete', 'Copy', 'Details'] : ['Download', 'Delete', 'Details'];
|
let menuList = showShare ? ['Share', 'Download','Delete', 'Divider', 'Copy', 'Details'] : ['Download', 'Delete', 'Divider', 'Details'];
|
||||||
return menuList;
|
return menuList;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type === 'file' && permission === 'rw') {
|
if (type === 'file' && permission === 'rw') {
|
||||||
let menuList = showShare ? ['Share', 'Download', 'Delete'] : ['Download', 'Delete'];
|
let menuList = showShare ? ['Share', 'Download', 'Delete', 'Divider'] : ['Download', 'Delete', 'Divider'];
|
||||||
|
|
||||||
if (!dirent.is_locked || (dirent.is_locked && dirent.locked_by_me)) {
|
if (!dirent.is_locked || (dirent.is_locked && dirent.locked_by_me)) {
|
||||||
menuList.push('Rename');
|
menuList.push('Rename');
|
||||||
@ -88,6 +88,7 @@ class DirentRightMenu extends React.Component {
|
|||||||
menuList.push('Lock');
|
menuList.push('Lock');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
menuList.push('Divider');
|
||||||
if (enableFileComment) {
|
if (enableFileComment) {
|
||||||
menuList.push('Comment');
|
menuList.push('Comment');
|
||||||
}
|
}
|
||||||
@ -96,12 +97,13 @@ class DirentRightMenu extends React.Component {
|
|||||||
menuList.push('Access Log');
|
menuList.push('Access Log');
|
||||||
}
|
}
|
||||||
menuList.push('Details');
|
menuList.push('Details');
|
||||||
|
menuList.push('Divider');
|
||||||
menuList.push('Open via Client');
|
menuList.push('Open via Client');
|
||||||
return menuList;
|
return menuList;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type === 'file' && permission === 'r') {
|
if (type === 'file' && permission === 'r') {
|
||||||
let menuList = showShare ? ['Share', 'Download', 'Delete'] : ['Download', 'Delete'];
|
let menuList = showShare ? ['Share', 'Download', 'Delete', 'Divider'] : ['Download', 'Delete', 'Divider'];
|
||||||
if (!currentRepoInfo.encrypted) {
|
if (!currentRepoInfo.encrypted) {
|
||||||
menuList.push('Copy');
|
menuList.push('Copy');
|
||||||
}
|
}
|
||||||
@ -277,9 +279,13 @@ class DirentRightMenu extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<div className='right-tree-menu'>
|
<div className='right-tree-menu'>
|
||||||
{this.state.menuList.map((menuItem, index) => {
|
{this.state.menuList.map((menuItem, index) => {
|
||||||
return (
|
if (menuItem === 'Divider') {
|
||||||
<button className='right-tree-item' key={index} data-toggle={menuItem} onClick={this.onMenuItemClick}>{this.translateMenuItem(menuItem)}</button>
|
return <div className="right-tree-divider"></div>
|
||||||
);
|
} else {
|
||||||
|
return (
|
||||||
|
<button className='right-tree-item' key={index} data-toggle={menuItem} onClick={this.onMenuItemClick}>{this.translateMenuItem(menuItem)}</button>
|
||||||
|
);
|
||||||
|
}
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -17,6 +17,14 @@
|
|||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
|
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.right-tree-divider {
|
||||||
|
height: 0;
|
||||||
|
margin: 0.5rem 0;
|
||||||
|
overflow: hidden;
|
||||||
|
border-top: 1px solid #e9ecef;
|
||||||
|
}
|
||||||
|
|
||||||
.right-tree-item {
|
.right-tree-item {
|
||||||
display: block;
|
display: block;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
Loading…
Reference in New Issue
Block a user