Skip to content

Commit 1935813

Browse files
author
hikki
committed
v3.2
1 parent e08a698 commit 1935813

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

resources/assets/component.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1789,12 +1789,19 @@ window.ComponentCascadeLine = class {
17891789
node_data.key = aim_node_data.key;
17901790
node_data.val = aim_node_data.val;
17911791
let index = node_data.nodes.indexOf(aim_node_data.key);
1792-
node_data.nodes.splice(index,1,tmp_key);
1792+
if(index !== -1) node_data.nodes.splice(index,1,tmp_key);
17931793

1794-
index = aim_node_data.parentNodes.indexOf(tmp_key);
1795-
aim_node_data.parentNodes.splice(index,1,aim_node_data.key);
17961794
aim_node_data.key = tmp_key;
17971795
aim_node_data.val = tmp_val;
1796+
let aimParentNode = aim_node_data.parentNodes.slice(0).pop();
1797+
for (let index in this.dimensional_data[aim_node_data.stack - 1]){
1798+
if(!this.dimensional_data[aim_node_data.stack - 1].hasOwnProperty(index))continue;
1799+
let d = this.dimensional_data[aim_node_data.stack - 1][index];
1800+
if(d.key === aimParentNode){
1801+
d.nodes.splice(d.nodes.indexOf(node_data.key),1,aim_node_data.key);
1802+
break;
1803+
}
1804+
}
17981805
this.resetChildrenParent(node_data);
17991806

18001807
node.querySelector('span').textContent = node_data.val;
@@ -1814,6 +1821,7 @@ window.ComponentCascadeLine = class {
18141821
this.dimensional_data[stack].forEach((d)=>{
18151822
if(nodes.indexOf(d.key) !== -1){
18161823
d.parentNodes = parents;
1824+
console.log(d)
18171825
if(Array.isArray(d.nodes) && d.nodes.length > 0){
18181826
this.resetChildrenParent(d);
18191827
}

0 commit comments

Comments
 (0)