1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-25 14:50:29 +00:00

change published wiki tree (#3940)

This commit is contained in:
Michael An
2019-08-02 20:48:58 +08:00
committed by Daniel Pan
parent aa4d7a8936
commit d62a5584b7

View File

@@ -249,16 +249,12 @@ class FolderItem extends React.Component {
});
}
expandChildNodes = () => {
this.setState({ expanded: true });
}
renderLink = (node) => {
const className = node.path === this.props.currentPath ? 'wiki-nav-content wiki-nav-content-highlight' : 'wiki-nav-content';
if (node.href && node.name) {
return <div className={className}><a href={node.href} data-path={node.path} onClick={this.expandChildNodes}>{node.name}</a></div>;
return <div className={className}><a href={node.href} data-path={node.path} onClick={this.toggleExpanded}>{node.name}</a></div>;
} else if (node.name) {
return <div className="wiki-nav-content"><span onClick={this.expandChildNodes}>{node.name}</span></div>;
return <div className="wiki-nav-content"><span onClick={this.toggleExpanded}>{node.name}</span></div>;
} else {
return null;
}