Franklinjagan / jsplumb

Automatically exported from code.google.com/p/jsplumb
0 stars 0 forks source link

Add access to the connector itself in event API #63

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I really like where your going with the mouseevents in 1.2.6. This is really an 
enhancement suggestion. It would make thing easier if you exposed the 
connection to the 'jsPlumbConnection' event so that one can easily bind the 
various mouse events to a newly dragged connector.

something like this:

_currentInstance.fireUpdate("jsPlumbConnection", {
 source : jpc.source, target : jpc.target,
 sourceId : jpc.sourceId, targetId : jpc.targetId,
 sourceEndpoint : jpc.endpoints[0], targetEndpoint : jpc.endpoints[1],
 connection : jpc
});  

thus allowing:

jsPlumb.bind("jsPlumbConnection", function(p) {  
  p.connection.bind("click", function(p) { .........}

--Tim

Original issue reported on code.google.com by triend...@gmail.com on 23 Mar 2011 at 8:15

GoogleCodeExporter commented 9 years ago
yeah you have to wonder why i didn't include it in the first place really, 
don't you ;)

i've checked this in.  i might go back and revisit the detach event, though - 
there's some code in there that fiddles with the source and target; i don't 
remember why i put it there and it seems odd.  

any other suggestions you have, i'm all ears.

Original comment by simon.po...@gmail.com on 23 Mar 2011 at 10:39

GoogleCodeExporter commented 9 years ago

Original comment by simon.po...@gmail.com on 2 Jun 2011 at 4:25