Skip to content

Commit

Permalink
Fixes #946
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdriscoll committed Jul 6, 2019
1 parent 7ae6a93 commit e02e775
Showing 1 changed file with 20 additions and 7 deletions.
27 changes: 20 additions & 7 deletions src/client/src/app/ud-treeview.jsx
Expand Up @@ -14,19 +14,32 @@ export default class UDTreeView extends React.Component {

onToggle(node, toggled)
{
fetchPost('/api/internal/component/element/' + this.props.id, { nodeId: node.id}, function(data) {
node.children = data;

if (this.props.hasCallback) {
fetchPost('/api/internal/component/element/' + this.props.id, { nodeId: node.id}, function(data) {
node.children = data;
if(this.state.cursor){this.state.cursor.active = false;}

node.active = true;

if(node.children){
node.toggled = toggled;
}

this.setState({ cursor: node })

}.bind(this))
}
else {
if(this.state.cursor){this.state.cursor.active = false;}

node.active = true;

if(node.children){
node.toggled = toggled;
}

this.setState({ cursor: node })

}.bind(this))
}


}

render(){
Expand Down

0 comments on commit e02e775

Please sign in to comment.