-
Notifications
You must be signed in to change notification settings - Fork 1
Conversation
src/tree/render.js
Outdated
if (nodeTree.data.navigationMode === 'free' && topNode.parent) { | ||
const ancestors = topNode.parent.ancestors(); | ||
ancestors.forEach(ancestor => { | ||
subTree.push(ancestor); | ||
subTree.push(...ancestor.children); | ||
}); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will lead to duplicates in the tree.
in free mode we could just as well keep the topNode static to the root OR if we want options later on just go up a few levels, then start adding nodes (instead of adding normally first, then ancestors.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The upside of having a topNode (which probably should be called main or active now...) is that the only thing that differs between the two modes is ancestors. So we can reuse the logic from before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could easily filter out the duplicates here actually. It would be great if we can keep the expandedState the same for all the navigation modes we use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be fixed now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a test for the filter function, just to be sure =).
Added unit test and merged master |
No description provided.