|
@@ -73,10 +73,6 @@ var idTree = {
|
|
var next = (pre && iIndex + count - 1 < children.length) ? children[iIndex + count] : null;
|
|
var next = (pre && iIndex + count - 1 < children.length) ? children[iIndex + count] : null;
|
|
if (pre) {
|
|
if (pre) {
|
|
pre.setNextSibling(next);
|
|
pre.setNextSibling(next);
|
|
- //pre.nextSibling = next;
|
|
|
|
- }
|
|
|
|
- if (next) {
|
|
|
|
- next.preSibling = pre;
|
|
|
|
}
|
|
}
|
|
if (arguments.length === 4) {
|
|
if (arguments.length === 4) {
|
|
children.splice(iIndex, count);
|
|
children.splice(iIndex, count);
|
|
@@ -99,10 +95,6 @@ var idTree = {
|
|
if (pre) {
|
|
if (pre) {
|
|
pre.setNextSibling(nodes[0]);
|
|
pre.setNextSibling(nodes[0]);
|
|
}
|
|
}
|
|
- nodes[0].preSibling = pre;
|
|
|
|
- if (next) {
|
|
|
|
- next.preSibling = nodes[nodes.length - 1];
|
|
|
|
- }
|
|
|
|
nodes[nodes.length - 1].setNextSibling(next);
|
|
nodes[nodes.length - 1].setNextSibling(next);
|
|
for (i = 0; i < nodes.length; i++) {
|
|
for (i = 0; i < nodes.length; i++) {
|
|
if (arguments.length === 4) {
|
|
if (arguments.length === 4) {
|
|
@@ -170,6 +162,9 @@ var idTree = {
|
|
};
|
|
};
|
|
Node.prototype.setNextSibling = function (nextSibling) {
|
|
Node.prototype.setNextSibling = function (nextSibling) {
|
|
this.nextSibling = nextSibling;
|
|
this.nextSibling = nextSibling;
|
|
|
|
+ if (nextSibling) {
|
|
|
|
+ nextSibling.preSibling = this;
|
|
|
|
+ }
|
|
if (this.tree.setting.autoUpdate) {
|
|
if (this.tree.setting.autoUpdate) {
|
|
this.data[this.tree.setting.nid] = this.getNextSiblingID();
|
|
this.data[this.tree.setting.nid] = this.getNextSiblingID();
|
|
}
|
|
}
|
|
@@ -250,7 +245,7 @@ var idTree = {
|
|
if (nextSibling) {
|
|
if (nextSibling) {
|
|
nextSibling.preSibling = preSibling;
|
|
nextSibling.preSibling = preSibling;
|
|
}
|
|
}
|
|
- this.children.splice(this.children.re)
|
|
|
|
|
|
+ this.children.splice(node.siblingIndex, 1);
|
|
};
|
|
};
|
|
|
|
|
|
Node.prototype.canUpLevel = function () {
|
|
Node.prototype.canUpLevel = function () {
|
|
@@ -338,8 +333,6 @@ var idTree = {
|
|
orgPre.preSibling.setNextSibling(this);
|
|
orgPre.preSibling.setNextSibling(this);
|
|
}
|
|
}
|
|
orgPre.setNextSibling(this.nextSibling);
|
|
orgPre.setNextSibling(this.nextSibling);
|
|
- this.preSibling = orgPre.preSibling;
|
|
|
|
- orgPre.preSibling = this;
|
|
|
|
this.setNextSibling(orgPre);
|
|
this.setNextSibling(orgPre);
|
|
belongArray.splice(iIndex, 1);
|
|
belongArray.splice(iIndex, 1);
|
|
belongArray.splice(iIndex - 1, 0, this);
|
|
belongArray.splice(iIndex - 1, 0, this);
|
|
@@ -370,10 +363,8 @@ var idTree = {
|
|
if (this.preSibling) {
|
|
if (this.preSibling) {
|
|
this.preSibling.setNextSibling(orgNext);
|
|
this.preSibling.setNextSibling(orgNext);
|
|
}
|
|
}
|
|
- orgNext.preSibling = this.preSibling;
|
|
|
|
this.setNextSibling(orgNext.nextSibling);
|
|
this.setNextSibling(orgNext.nextSibling);
|
|
orgNext.setNextSibling(this);
|
|
orgNext.setNextSibling(this);
|
|
- this.preSibling = orgNext;
|
|
|
|
belongArray.splice(iIndex, 1);
|
|
belongArray.splice(iIndex, 1);
|
|
belongArray.splice(iIndex + 1, 0, this);
|
|
belongArray.splice(iIndex + 1, 0, this);
|
|
tools.sortTreeItems(this.tree);
|
|
tools.sortTreeItems(this.tree);
|
|
@@ -572,9 +563,6 @@ var idTree = {
|
|
if (node.preSibling) {
|
|
if (node.preSibling) {
|
|
node.preSibling.setNextSibling(node.nextSibling);
|
|
node.preSibling.setNextSibling(node.nextSibling);
|
|
}
|
|
}
|
|
- if (node.nextSibling) {
|
|
|
|
- node.nextSibling.preSibling = node.preSibling;
|
|
|
|
- }
|
|
|
|
if (node.parent) {
|
|
if (node.parent) {
|
|
node.parent.children.splice(node.siblingIndex(), 1);
|
|
node.parent.children.splice(node.siblingIndex(), 1);
|
|
} else {
|
|
} else {
|
|
@@ -622,4 +610,4 @@ var idTree = {
|
|
return new Tree(setting);
|
|
return new Tree(setting);
|
|
},
|
|
},
|
|
updateType: {update: 'update', new: 'new', delete: 'delete'}
|
|
updateType: {update: 'update', new: 'new', delete: 'delete'}
|
|
-};
|
|
|
|
|
|
+};
|