|
@@ -393,6 +393,7 @@ const createNewPathTree = function (type, setting) {
|
|
|
for (const d of this.datas) {
|
|
|
d.filter = defaultValue;
|
|
|
}
|
|
|
+ const parents = [];
|
|
|
for (const s of this.select) {
|
|
|
const node = this.getItems(s);
|
|
|
if (!node) continue;
|
|
@@ -401,10 +402,12 @@ const createNewPathTree = function (type, setting) {
|
|
|
for (const p of posterity) {
|
|
|
p.filter = !defaultValue;
|
|
|
}
|
|
|
- const parents = this.getAllParents(node);
|
|
|
- for (const p of parents) {
|
|
|
- p.filter = !defaultValue;
|
|
|
- }
|
|
|
+ parents.push(...this.getAllParents(node));
|
|
|
+ }
|
|
|
+ parents.sort((x, y) => { return y.level - x.level});
|
|
|
+ for (const parent of parents) {
|
|
|
+ parent.filter = !parent.children.find(x => { return !x.filter });
|
|
|
+
|
|
|
}
|
|
|
for (const node of this.nodes) {
|
|
|
const parent = this.getParent(node);
|