cytoscape / cytoscape.js-compound-drag-and-drop

Compound node drag-and-drop UI for adding and removing children
MIT License
33 stars 16 forks source link

feat: improve drop check callbacks by adding both nodes #19

Closed sashokbg closed 2 years ago

sashokbg commented 2 years ago

Hello,

I am proposing this minor update of both dropTarget and dropSiblings callbacks:

By passing both the grabbed node and the node target, we allow for a more refined conditions on which node can be dropped upon which other.

I kept the first argument the "target" node to insure compatibility for users who already use these callbacks

maxkfranz commented 2 years ago

Looks good