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

add onDisplay event #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

add onDisplay event #21

wants to merge 1 commit into from

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