iVis-at-Bilkent / cytoscape.js-context-menus

A Cytoscape.js extension to provide context menu around elements and core instance
MIT License
86 stars 41 forks source link

Submenu #48

Closed onsah closed 4 years ago

onsah commented 4 years ago

Adds the submenu feature described in #10 Some highlights:

For the details refer to the documentation (mostly changes are in the api section)

Note: This PR should be merged after #47 because it is built on it

onsah commented 4 years ago

@hasanbalci This PR is now ready to be merged.

onsah commented 4 years ago

A few comments for now:

* For example, I have
blue -> light blue
green

and if I move light blue to parent menu by using moveToSubmenu function then submenu indicator still exists even though there is no submenu anymore.

* In the demo, if I click on 'change color' item, I get error in console.

Thanks for noticing this issue. It is caused because I changed moveToSubmenu just detaching from the parent instead of removing it, because when removing a menu item is also destroyed. But this is a problem for moving items that contain a submenu. I am trying to find a good solution.

For the second issue, what kind of error do you get? Can you provide the error because I don't get any error in the console when I click 'change-color'.

Edit: I got the error for the second case. It turns out that I was checking wrong property while determining whether the menu item has click function or not.