|
|
@@ -272,7 +272,10 @@ const pmTree = {
|
|
|
}
|
|
|
that.maxNodeId(node.id());
|
|
|
if(parent.childIndex(node) === -1){
|
|
|
- if(pre && parent.childIndex(pre) !== -1){
|
|
|
+ if (!pre) {
|
|
|
+ parent.children.unshift(node);
|
|
|
+ }
|
|
|
+ else if(pre && parent.childIndex(pre) !== -1){
|
|
|
parent.children.splice(parent.childIndex(pre) + 1, 0, node);
|
|
|
}
|
|
|
else if(next && parent.childIndex(next) !== -1){
|