Skip to content

Commit

Permalink
reuse dijit's getTreePath to compute the path
Browse files Browse the repository at this point in the history
  • Loading branch information
panthony authored and fbacchella committed Apr 23, 2015
1 parent c86dda7 commit 58450c2
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions web/lib/jrds.js
Expand Up @@ -938,22 +938,7 @@ function toggleFold() {
}
}

function getTreeNodeUp(node) {
var nodeInfo = node.item.id;
if(nodeInfo instanceof Array) {
nodeInfo = nodeInfo[0];
}
if(node.item.root) {
return new Array(nodeInfo);
}
retValue = getTreeNodeUp(node.getParent());
retValue.push(nodeInfo);
return retValue;
}

function loadTree(item, node){
var tree = node.tree;

if(item.filter) {
queryParams.filter = item.filter[0];
delete queryParams.host;
Expand All @@ -975,7 +960,7 @@ function loadTree(item, node){
else {
queryParams.id = item.id[0].replace(/.*\./, "");
getGraphList();
queryParams.path = getTreeNodeUp(node);
queryParams.path = node.getTreePath().map(function(node) { return node.id instanceof Array ? node.id[0] : node.id; });
}
}

Expand Down

0 comments on commit 58450c2

Please sign in to comment.