Nikatlas 5 years ago
parent
commit
911220acc0
3 changed files with 8 additions and 2 deletions
  1. 7 1
      App.js
  2. 0 0
      dist/lib/helpers/tree.js
  3. 1 1
      lib/helpers/tree.js

+ 7 - 1
App.js

@@ -58,6 +58,7 @@ let nodeA = new Node("A", {justifyContent: 'flex-end', stretchContainer: true, s
 let nodeB = new Node("B", {justifyContent: 'flex-end' , selected: true}, ImageNode);
 let nodeC = new Node("C", {alignSelf: 'flex-end' , selected: true}, ImageNode);
 let nodeD = new Node("D");
+let nodeE = new Node("E", {alignSelf: 'flex-end' , selected: true}, ImageNode);
 
 let VS = new View();
 let root = VS.defaultContainer;
@@ -67,7 +68,12 @@ VS
 .addViewNode(nodeB, nodeA)
 .addViewNode(nodeC, nodeA)
 .addViewNode(nodeD, nodeA);
+let datata = VS.export();
 
+let VS2 = new View();
+VS2
+.addViewNode(nodeE, VS2.defaultContainer)
+.import(datata, nodeE.id);
 
 // let rowss = VS.setRows(root, 1)[0];
 // VS.setColumns(rowss, 2);
@@ -120,7 +126,7 @@ VS.replace(NodeK,EditNode)
 //**************************************  Routing Ends
 
 let CS = new CoreSystem()
-.addPage('test', VS, 'VS1')
+.addPage('test', VS2, 'VS1')
 .setHome('test');
 
 

File diff suppressed because it is too large
+ 0 - 0
dist/lib/helpers/tree.js


+ 1 - 1
lib/helpers/tree.js

@@ -175,7 +175,7 @@ class Tree extends Graph {
 			this.levels = levels.map(setArray => new Set(setArray));
 		} else {
 			this.linkNodes(parentNode, rootId);
-			this.updateLevels(parentNode);
+			this.updateLevels(this.getNode(parentNode));
 		}
 	}
 

Some files were not shown because too many files changed in this diff