Hareeshchandera / jsplumb

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

add enable/disable functionality to Endpoint ( was: Setting maxConnections to 0 is treated like 1 on an endpoint) #206

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
If you set maxConnections on an endpoint to 0, I would have expected that no 
connections would be made to / from it.  However, it's treated like setting it 
to maxConnections = 1.

Original issue reported on code.google.com by lhfied...@gmail.com on 24 Feb 2012 at 9:21

GoogleCodeExporter commented 8 years ago
that's true. i suppose this is because i didn't expect people to create 
endpoints they couldn't use.

there is no programmatic API to change that value. you're certain you want the 
ability to create an endpoint that sits just there?

Original comment by simon.po...@gmail.com on 24 Feb 2012 at 9:42

GoogleCodeExporter commented 8 years ago
Guess not.  Is there a way to disable the endpoint?

Original comment by lhfied...@gmail.com on 25 Feb 2012 at 2:31

GoogleCodeExporter commented 8 years ago
it sounds to me like that is what is missing from the api - some kind of 
setEnabled call on Endpoints.

Original comment by simon.po...@gmail.com on 25 Feb 2012 at 6:33

GoogleCodeExporter commented 8 years ago
i've added this now - you can set an 'enabled' parameter on an Endpoint:

var ep = jsPlumb.addEndpoint("foo", {
 anchor:"TopCenter",
  enabled:false
});

and you can set it programmatically:

ep.setEnabled(true);

and you can ask it about whether or not it is enabled:

console.log(ep.isEnabled());

Original comment by simon.po...@gmail.com on 27 Feb 2012 at 4:06