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

Wiki sidebar bug (#2321)

* repair rename bug

* modify rename module and  search module

* add hight-light style for tree-node
This commit is contained in:
shanshuirenjia
2018-09-01 11:34:27 +08:00
committed by Daniel Pan
parent 285fa43387
commit 99e9c8b1c0
6 changed files with 79 additions and 35 deletions

View File

@@ -114,6 +114,7 @@ class TreeNodeView extends React.Component {
treeView={this.props.treeView}
isNodeItemFrezee={this.props.isNodeItemFrezee}
permission={this.props.permission}
currentFileNode={this.props.currentFileNode}
/>
);
})}
@@ -171,9 +172,14 @@ class TreeNodeView extends React.Component {
const styles = {};
let node = this.props.node;
let { type, icon } = this.getNodeTypeAndIcon();
let hlClass = "";
if (node.path === this.props.currentFileNode.path) {
hlClass = "tree-node-hight-light";
}
let customClass = "tree-node " + hlClass;
return (
<div type={type} className="tree-node" style={styles}>
<div type={type} className={customClass} style={styles}>
<div
onMouseLeave={this.onMouseLeave}
onMouseEnter={this.onMouseEnter}

View File

@@ -53,6 +53,7 @@ class TreeView extends React.PureComponent {
node={this.props.treeData.root}
isNodeItemFrezee={this.props.isNodeItemFrezee}
permission={this.props.permission}
currentFileNode={this.props.currentFileNode}
onShowContextMenu={this.props.onShowContextMenu}
/>
</div>

View File

@@ -88,6 +88,15 @@ class Tree {
return findNode;
}
updateNodeParamValue(node, param, value) {
let findNode = this.getNodeByPath(node.path);
if (findNode[param]) {
findNode[param] = value;
return true;
}
return false;
}
traverseDF(callback) {
let stack = [];
let found = false;