Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collapse / expand the root node #280

Open
jpdelmundo opened this issue Sep 24, 2024 · 2 comments
Open

Collapse / expand the root node #280

jpdelmundo opened this issue Sep 24, 2024 · 2 comments

Comments

@jpdelmundo
Copy link

Is your feature request related to a problem? Please describe.
There is no way to collapse / expand the root node.

Describe the solution you'd like
Something like mind.collapseNode(mind.currentNode) or mind.expandNode(mind.currentNode) or mind.toggleNode(<root node>). Or something built-in the context menu. I could set expanded: bool to collapse / expand a node but it does not work on the root node.

Describe alternatives you've considered
I could set expanded: bool to collapse / expand a node but it does not work on the root node.

@SSShooter
Copy link
Owner

It's not easy to find a specific position to place the expander of root node. I tried another mindmap app (xmind) just now, it seems also doesn't let you collapse the root node.

@jpdelmundo
Copy link
Author

It doesn't necessarily need to be an expander icon on the root node. It could be in the context menu.

What I've done is oncontextmenu, if nodeObj.expanded == true, I set the contextMenuOption name to "Collapse All", otherwise it is "Expand All". Then onclick, I set mind.currentNode.nodeObj.expanded to true/false, and do the same recursively on mind.currentNode.nodeObj.children.

The only problem is the root node nodeObj does not effectively have an expanded property.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants