Closed arnonrdp closed 2 years ago
It doesn't have this feature so far, but anyway, you can achieve it with this snippet.
mind.bus.addListener('expandNode', node => {
if (node.expanded === false) return
walk(mind.nodeData.children)
while (node.parent) {
node.expanded = true
node = node.parent
}
mind.refresh()
})
function walk(children) {
for (let i = 0; i < children.length; i++) {
const child = children[i]
child.expanded = false
if (child.children) walk(child.children)
}
}
Simple and direct solution. Really appreciate it! Thanks a lot!
First of all, congratulations on your repo. I already starred it.
I'm creating a mind map with a lot of data and it wouldn't be interesting to allow the user to leave everything expanded.
So I would like to know if it is possible to define that whenever the user expands a series, the others are collapsed.
Thank you very much in advance.