Closed GoogleCodeExporter closed 8 years ago
hello,
this might actually need to be added to jsPlumb - you want to set a new image
on the Endpoint, basically, right? there is no method to do that right now.
shall we turn this into an enhancement request and put it in 1.3.4?
Original comment by simon.po...@gmail.com
on 8 Nov 2011 at 8:32
Yes, that's right. I finally do it throught conn.sourceEndpoint.canvas.src but
I don't know if it could have colateral effects. I'll use this new function in
1.3.4.
I have create an example in jsfiddle, you can find it in
http://jsfiddle.net/danielmartinezruiz/rhyhv/2/ . I hope this could help you.
Additionally, I cannot use isFull function cause the source isFloating and it
never gives me true but I solved it with (val.connectorSelector() != null).
Thanks for your support.
Original comment by daniel.martinez.ruiz
on 10 Nov 2011 at 10:25
cool, thanks for the link.
i will make this an enhancement and put it in 1.3.4: your workaround solution
is ok in this case because the images are similar sizes, but the code that
creates the wrapper div runs only once, so if you swapped out for a bigger
image i think this would fall down. the setter method that i'll add will just
mark the endpoint as dirty for the next repaint, and it will get resized
properly.
for convenience i'll have the setImage method accept both a url and an existing
Image.
Original comment by simon.po...@gmail.com
on 10 Nov 2011 at 9:49
The example I made had internet images with different sizes, but my program
solution has images with the same size. Thanks for the enhancement. I will be
aware for 1.3.4 version.
Original comment by daniel.martinez.ruiz
on 11 Nov 2011 at 10:16
i've added this to 1.3.4 now:
setImage(img, onload)
'img' can be either a string or an Image. 'onload' is optional, and replaces
any current onload on the Image endpoint.
Original comment by simon.po...@gmail.com
on 26 Dec 2011 at 9:09
1.3.4 was released today.
Original comment by simon.po...@gmail.com
on 9 Jan 2012 at 6:58
Original issue reported on code.google.com by
daniel.martinez.ruiz
on 8 Nov 2011 at 1:20