Link mouseDragEnter only on nodes from palette


I Currently use GoJS and like it a lot, i have a diagram with a palette besides it. (Looks a lot like the flowchart example). Currently I implemented the mouseDragEnter and leave function on links, so if you drag an node from the palette and hover it over the link the link highlights, then i implemented the mouseDrop to put the dropped object between the hovered link.

The situation stated above is currently working fine for new items dropped from the palette. Only problem is when an existing item is dropped/hovered on a link the same code executes and that is not wanted.

My question: Is there any way to identify the node that is being dragged in the mouseDrop. mouseDragEnter and mouseDragLeave functions, and see if it is a new node or an already existing node.

Hope you can help me with this, love the product !

If you need any more info, let me know.

Sure, just look at the Diagram.currentTool. If it’s a DraggingTool you know it’s an internal drag-and-drop.

1 Like

Thanks for the super fast reaction, works great !