mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-09 10:50:24 +00:00
Add option to only show folder in nav side panel (#6541)
* fix conflict * remove redundant code * add space at the end of css * update ui
This commit is contained in:
@@ -26,6 +26,7 @@ const propTypes = {
|
||||
handleContextClick: PropTypes.func.isRequired,
|
||||
onNodeDragEnter: PropTypes.func.isRequired,
|
||||
onNodeDragLeave: PropTypes.func.isRequired,
|
||||
isDisplayFiles: PropTypes.bool,
|
||||
};
|
||||
|
||||
class TreeNodeView extends React.Component {
|
||||
@@ -264,6 +265,7 @@ class TreeNodeView extends React.Component {
|
||||
onNodeDragEnter={this.props.onNodeDragEnter}
|
||||
onNodeDragLeave={this.props.onNodeDragLeave}
|
||||
handleContextClick={this.props.handleContextClick}
|
||||
isDisplayFiles={this.props.isDisplayFiles}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
@@ -279,6 +281,10 @@ class TreeNodeView extends React.Component {
|
||||
hlClass = 'tree-node-hight-light';
|
||||
}
|
||||
|
||||
if (node.path !== '/' && type !== 'dir' && !this.props.isDisplayFiles) {
|
||||
return '';
|
||||
}
|
||||
|
||||
const { isCustomPermission } = Utils.getUserPermission(userPerm);
|
||||
return (
|
||||
<div className="tree-node">
|
||||
|
@@ -23,6 +23,7 @@ const propTypes = {
|
||||
posX: PropTypes.number,
|
||||
posY: PropTypes.number,
|
||||
getMenuContainerSize: PropTypes.func,
|
||||
isDisplayFiles: PropTypes.bool,
|
||||
};
|
||||
|
||||
const LEFT_INDENT = 20;
|
||||
@@ -343,6 +344,7 @@ class TreeView extends React.Component {
|
||||
onNodeDragEnter={this.onNodeDragEnter}
|
||||
onNodeDragLeave={this.onNodeDragLeave}
|
||||
handleContextClick={this.handleContextClick}
|
||||
isDisplayFiles={this.props.isDisplayFiles}
|
||||
/>
|
||||
<ContextMenu
|
||||
id={'tree-node-contextmenu'}
|
||||
|
Reference in New Issue
Block a user