Skip to content

Conversation

@earx
Copy link

@earx earx commented Nov 28, 2017

to allow control menu item visibility depending on node state - for example - disable "expand" menu item if the node is expanded"

…n node state - for example - disable "expand" menu item if node is expanded"
@kinimesi
Copy link
Collaborator

@earx If I understood correctly, you are trying to show/hide a context menu item depending on expanded/collapsed state of a node. This can be done by using selectors.

See: https://github.com/iVis-at-Bilkent/newt/blob/2c7697db7e613f43dcb5de94003a1573c35b3760/app/js/app-cy.js#L124 and https://github.com/iVis-at-Bilkent/newt/blob/2c7697db7e613f43dcb5de94003a1573c35b3760/app/js/app-cy.js#L137

@earx
Copy link
Author

earx commented Nov 28, 2017

Hi!
Thank you for your reply. I think using callback is more flexible, as node state can be changed, or if I will need to set / clear 'disabled' attribute for the menu item, or change color, or something else.

@ugurdogrusoz
Copy link
Contributor

will this work when expand/collapse extension is not in use?

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

Successfully merging this pull request may close these issues.

3 participants