SEARCH WORKS

This commit is contained in:
Curtis SerVaas
2014-10-16 15:36:16 -04:00
parent 3dabfe79fd
commit 61284b39df
15 changed files with 355 additions and 322 deletions
+14
View File
@@ -1,3 +1,17 @@
var NodeModel = Backbone.Model.extend({
getAncestry: function(){
var that = this;
var ancestry = [];
var parents = that.get("parents");
while(parents.length != 0){
ancestry.push(parents);
parents = nodesCollection.findWhere({_id: parents[0]}).get("parents");
// parents = that.findModel(parents[0]).get("parents");
//making the assumption/simplification that it's a tree. Not a graph.
}
return ancestry;
}
});