Skip to content

Commit

Permalink
fix behavior3#5 - open/import projects with nested trees
Browse files Browse the repository at this point in the history
  • Loading branch information
Talisca committed Oct 10, 2015
1 parent ec2d82f commit d143bc2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/editor/editor/managers/ImportManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ b3e.editor.ImportManager = function(editor) {
var project = editor.project.get();
if (!project) return;

var tree = project.trees.add(data.id);
var tree = project.trees.get(data.id);
var root = tree.blocks.getRoot();
var first = null;

Expand Down Expand Up @@ -98,6 +98,10 @@ b3e.editor.ImportManager = function(editor) {
};

this.treesAsData = function(data) {
var project = editor.project.get();
data.forEach(function(tree){
project.trees.add(tree.id);
});
for (var i=0; i<data.length; i++) {
this.treeAsData(data[i]);
}
Expand Down

0 comments on commit d143bc2

Please sign in to comment.