collapse/expand only folder notes

This commit is contained in:
zadam
2020-05-03 09:49:56 +02:00
parent 9be1d1f697
commit 742df25bc2
4 changed files with 15 additions and 6 deletions

View File

@@ -611,7 +611,11 @@ export default class NoteTreeWidget extends TabAwareWidget {
// unfortunately the two steps can't be combined
await node.visitAndLoad(_ => {}, true);
node.visit(node => node.setExpanded(true), true);
node.visit(node => {
if (node.isFolder()) {
node.setExpanded(true);
}
}, true);
}
finally {
this.tree.autoLoadingDisabled = false;
@@ -627,7 +631,11 @@ export default class NoteTreeWidget extends TabAwareWidget {
}
this.batchUpdate(() => {
node.visit(node => node.setExpanded(false), true);
node.visit(node => {
if (node.isFolder()) {
node.setExpanded(false);
}
}, true);
});
}