Expand tree when selecting node
This commit is contained in:
parent
1a49884a3a
commit
b35bb30631
1
TODO
1
TODO
@ -1,5 +1,4 @@
|
|||||||
* Fix dynamic tree updates when adding a new node
|
* Fix dynamic tree updates when adding a new node
|
||||||
* Expand tree to show selected node when going throw goToNode()
|
|
||||||
* Create new admin user when no user exists
|
* Create new admin user when no user exists
|
||||||
* File deletion
|
* File deletion
|
||||||
- per file
|
- per file
|
||||||
|
@ -253,6 +253,7 @@ class Tree extends Component {
|
|||||||
this.selectedTreeNode = this.treeNodeComponents[node.ID].current
|
this.selectedTreeNode = this.treeNodeComponents[node.ID].current
|
||||||
this.selectedTreeNode.selected.value = true
|
this.selectedTreeNode.selected.value = true
|
||||||
this.selectedTreeNode.expanded.value = true
|
this.selectedTreeNode.expanded.value = true
|
||||||
|
this.expandToTrunk(node.ID)
|
||||||
}//}}}
|
}//}}}
|
||||||
crumbsUpdateNodes(node) {//{{{
|
crumbsUpdateNodes(node) {//{{{
|
||||||
this.props.app.startNode.Crumbs.forEach(crumb=>{
|
this.props.app.startNode.Crumbs.forEach(crumb=>{
|
||||||
@ -272,6 +273,17 @@ class Tree extends Component {
|
|||||||
if(node !== undefined)
|
if(node !== undefined)
|
||||||
this.setSelected(node)
|
this.setSelected(node)
|
||||||
}//}}}
|
}//}}}
|
||||||
|
expandToTrunk(nodeID) {//{{{
|
||||||
|
let node = this.treeNodes[nodeID]
|
||||||
|
if(node === undefined)
|
||||||
|
return
|
||||||
|
|
||||||
|
node = this.treeNodes[node.ParentID]
|
||||||
|
while(node !== undefined) {
|
||||||
|
this.treeNodeComponents[node.ID].current.expanded.value = true
|
||||||
|
node = this.treeNodes[node.ParentID]
|
||||||
|
}
|
||||||
|
}//}}}
|
||||||
}
|
}
|
||||||
|
|
||||||
class TreeNode extends Component {
|
class TreeNode extends Component {
|
||||||
|
Loading…
Reference in New Issue
Block a user