Hareeshchandera / jsplumb

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

add setTargetEnabled/setSourceEnabled and related) methods #235

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
from this discussion on the group:

https://groups.google.com/forum/?fromgroups#!topic/jsplumb/Lil1CDtjNW4

Original issue reported on code.google.com by simon.po...@gmail.com on 14 Apr 2012 at 2:03

GoogleCodeExporter commented 8 years ago
Simon, 

already mentioned are:

setTargetEnabled/setSourceEnabled (subjectively: make live easier)
toggleTargetEnabled/toggleSourceEnabled (subjectively: optional)
unmakeTarget/unmakeSource (subjectively: make live easier)

makeTarget/makeSource in my mind realize additional abstraction level over 
endpoints. In order to keep the uniformity of the implemented methods I would 
like to propose to add 

- removeEveryTarget/removeEverySource (as analog 
removeEveryEndpoint)(subjectively: optional)
- isTarget/isSource (as analog of isEnabled)(subjectively: optional)

if the realization is not complex...  

Original comment by nik.demi...@googlemail.com on 14 Apr 2012 at 10:25

GoogleCodeExporter commented 8 years ago
i have added these methods to 1.3.9 dev:

                setTargetEnabled
        setSourceEnabled

        isTarget
        isSource

        toggleTargetEnabled
        toggleSourceEnabled

        isTargetEnabled
        isSourceEnabled

        unmakeSource                (returns current jsPlumb instance)
        unmakeTarget                (returns current jsPlumb instance)

        unmakeEverySource           (returns current jsPlumb instance)
        unmakeEveryTarget           (returns current jsPlumb instance)

in addition,  I changed makeTarget and makeSource so that they return the 
current jsPlumb instance, allowing them to be used in a 'fluent' way.

this will be released with jsPlumb 1.3.9 fairly soon.

Original comment by simon.po...@gmail.com on 22 May 2012 at 1:49