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

contextMenuClasses are not applied correctly #44

Closed cosmorunner closed 4 years ago

cosmorunner commented 4 years ago

Hi there,

when I use the following option: contextMenuClasses: [ 'border', 'm-0', 'border-primary' ]

The classes are applied as shown here: <div class="border cy-context-menus-cxt-menu" m-0="" border-primary="" style="inset: auto 615px 432px auto;">...</div>

It seems that only the first class is applied. Or am I missing something?

Cheers!

hasanbalci commented 4 years ago

@cosmorunner It seems that you're right. I fixed the issue in the "unstable" branch. Can you please test and verify? If it's ok, the fix will be available with the next release.

canbax commented 4 years ago

I see the same issue. I can confirm that it is fixed. Thank you.

On the other hand, I see that customization with existing CSS classes is a bit hard. You should override CSS on the default classes. I don't want my elements to have cy-context-menus-cxt-menuitem or cy-context-menus-cxt-menu CSS classes.

I think when we specify custom class names, these default classes should not be used at all. Because the user can add these classes manually.