Hi, I 've implemented two function :
Auto add link when a node(node A) - dragged close to another (node B)
Auto make 2 “bridge” links to replace 1 old link when a node is dragged onto an existing link
that is : dragging a node C and positioning it in the middle of a link between node A and node B will do the following: 1) delete the link between A and B, 2) create link between A and C, 3) create link between C and B
The first function works fine if i drag a node (node A) that is already in the diagram close to another( node B) . But if i drag a node in a palette to the diagram and close to another node they are linked and when i “mouse-up” the link disappears.
The second function meet the same problem that it works fine with the node C in the diagram but when node C is in the palette the link disappears at last when i “mouse-up”
I don’t know why. Please help me with this.
you can see my example here: http://jsfiddle.net/thanhvu231/ufVUr/