cytoscape.js-context-menus icon indicating copy to clipboard operation
cytoscape.js-context-menus copied to clipboard

add onDisplay event

Open earx opened this issue 7 years ago • 3 comments

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

earx avatar Nov 28 '17 12:11 earx

@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

kinimesi avatar Nov 28 '17 12:11 kinimesi

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.

earx avatar Nov 28 '17 13:11 earx

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

ugurdogrusoz avatar Jun 12 '19 06:06 ugurdogrusoz