Hi I want to detect when one element is dragged around and dropped on another element.
In plain JavaScript I would react to the ondragend event. But how do I do this with JointJS v.0.6.
I can see no drag-events there.
All I can see are the "cell:pointerup" and "cell:pointer-down events on the paper.
Thus I added the following two handler to my code:
this.paper.on( "cell:pointerdown", function( cellview, evt, x, y) {
});
this.paper.on( "cell:pointerup", function( cellview, evt, x, y) {
});
The ein started to drag around elements.
I learned that as cellview I always get the one for the element I dragged around.
Thus my plan was to in the pointerup method take the mouse position and then find the object(s) at this position and then fint out what element I dropped onto.
However I found, that the mouse coordinates are undefined.
pointer down on cell 50a9e6b6-9e98-4ba7-8b7a-70dfdccf7094 pos: 60 , 25 VsfGraph.js:353 pointer up on cell 50a9e6b6-9e98-4ba7-8b7a-70dfdccf7094 pos: undefined , undefined VsfGraph.js:357 pointer down on cell 50a9e6b6-9e98-4ba7-8b7a-70dfdccf7094 pos: 205 , 320 VsfGraph.js:353 pointer up on cell 50a9e6b6-9e98-4ba7-8b7a-70dfdccf7094 pos: undefined , undefined
Is there a way to find out where or on what element I dropped something?
Or can how can I define an handler for the ondragend or onmouseenter events?