|
5 | 5 | if (note.noteId === subRoot.note.noteId) return null; |
6 | 6 |
|
7 | 7 | const parent = note.getParentNotes()[0]; |
8 | | - const children = parent.getChildNotes(); |
| 8 | + const children = parent.getVisibleChildNotes(); |
9 | 9 | const index = children.findIndex(n => n.noteId === note.noteId); |
10 | 10 |
|
11 | 11 | // If we are the first child, previous goes up a level |
|
15 | 15 | // We are not the first child at this level so previous |
16 | 16 | // should go to the end of the previous tree |
17 | 17 | let candidate = children[index - 1]; |
18 | | - while (candidate.hasChildren()) { |
19 | | - const children = candidate.getChildNotes(); |
| 18 | + while (candidate.hasVisibleChildren()) { |
| 19 | + const children = candidate.getVisibleChildNotes(); |
20 | 20 | const lastChild = children[children.length - 1]; |
21 | 21 | candidate = lastChild; |
22 | 22 | } |
|
27 | 27 | const nextNote = (() => { |
28 | 28 | // If this currently active note has children, next |
29 | 29 | // should be the first child |
30 | | - if (note.hasChildren()) return note.getChildNotes()[0]; |
| 30 | + if (note.hasVisibleChildren()) return note.getVisibleChildNotes()[0]; |
31 | 31 |
|
32 | 32 | let parent = note.getParentNotes()[0]; |
33 | | - let children = parent.getChildNotes(); |
| 33 | + let children = parent.getVisibleChildNotes(); |
34 | 34 | let index = children.findIndex(n => n.noteId === note.noteId); |
35 | 35 |
|
36 | 36 | // If we are not the last of the current level, just go |
|
44 | 44 |
|
45 | 45 | const originalParent = parent; |
46 | 46 | parent = parent.getParentNotes()[0]; |
47 | | - children = parent.getChildNotes(); |
| 47 | + children = parent.getVisibleChildNotes(); |
48 | 48 | index = children.findIndex(n => n.noteId === originalParent.noteId); |
49 | 49 | } |
50 | 50 |
|
|
0 commit comments