Skip to content

Commit 857d74b

Browse files
author
hikki
committed
1.8
1 parent 6bc5157 commit 857d74b

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

resources/assets/component.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ class ComponentCascadeDot {
312312
let parent_nodes = JSON.parse(element.getAttribute('data-parent-nodes-id'));
313313
if (Array.isArray(parent_nodes)) {
314314
for (let stack in parent_nodes) {
315-
this.selectToParent(checked,parent_nodes[stack], stack, parent_nodes[stack - 1]);
315+
this.selectToParent(checked,parent_nodes[stack], parseInt(stack), parent_nodes[stack - 1],parent_nodes[stack + 1]);
316316
}
317317
}
318318
}
@@ -367,12 +367,19 @@ class ComponentCascadeDot {
367367
this.SELECTED_DOM.append(div);
368368
}
369369

370-
selectToParent(checked,node, stack, parent_node) {
370+
selectToParent(checked,node, stack, parent_node,child_nodes) {
371371
let currentStackDocuments = this.STACKS[stack].childNodes;
372372
currentStackDocuments.forEach((D, index) => {
373373
if(checked == 'true'){
374374
if (node == parseInt(D.getAttribute('data-id'))) {
375-
375+
let check = false;
376+
console.log(stack)
377+
this.STACKS[stack+1].childNodes.forEach((D)=>{
378+
if(D.getAttribute('checked') == 'true'){
379+
check = true;
380+
}
381+
});
382+
!check && D.querySelector('i').remove();
376383
}
377384
return;
378385
}

0 commit comments

Comments
 (0)