|
@@ -252,6 +252,31 @@ export class View {
|
|
return this.ViewTree.getChildren(node);
|
|
return this.ViewTree.getChildren(node);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ getBefore(node){
|
|
|
|
+ let DepthNodes = this.ViewTree.levels[node.depth]
|
|
|
|
+ DepthNodes = Array.from(DepthNodes);
|
|
|
|
+ let nodeIndex = DepthNodes.indexOf(node.id);
|
|
|
|
+ if(DepthNodes[nodeIndex - 1]){
|
|
|
|
+ return this.ViewTree.nodes[DepthNodes[nodeIndex - 1]]
|
|
|
|
+ }else{
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ getAfter(node){
|
|
|
|
+ let DepthNodes = this.ViewTree.levels[node.depth]
|
|
|
|
+ DepthNodes = Array.from(DepthNodes);
|
|
|
|
+ let nodeIndex = DepthNodes.indexOf(node.id);
|
|
|
|
+ if(DepthNodes[nodeIndex + 1]){
|
|
|
|
+ return this.ViewTree.nodes[DepthNodes[nodeIndex + 1]]
|
|
|
|
+ }else{
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
import(data, parentNode) {
|
|
import(data, parentNode) {
|
|
let { tree, ghosts } = data;
|
|
let { tree, ghosts } = data;
|
|
if(!parentNode)
|
|
if(!parentNode)
|