working on U4-3442 tree sync doesn't work for nodes that are not loaded

This commit is contained in:
Shannon
2013-11-07 17:53:46 +11:00
parent 31448eb987
commit 30fe174601

View File

@@ -202,7 +202,10 @@ function treeService($q, treeResource, iconHelper, notificationsService, $rootSc
},
/** Gets a child node by id */
getChildNode: function(treeNode, id) {
getChildNode: function (treeNode, id) {
if (!treeNode.children) {
throw "The current tree node has no assigned children, ensure it's children are loaded before calling this method";
}
var found = _.find(treeNode.children, function (child) {
return String(child.id) === String(id);
});