Help displaying dialog before drop.

314 views
Skip to first unread message

Chris R.

unread,
Mar 2, 2012, 4:38:12 PM3/2/12
to jsp...@googlegroups.com

I'm trying to display a dialog when a connection is being established by drag and drop.

I'm modifying the makeTarget call in the stateMachineDemo.js:

jsPlumb.makeTarget(jsPlumb.getSelector(".w"), {

dropOptions:{ hoverClass:"dragHover" },

anchor:"Continuous",

isTarget:true,

beforeDrop:function(params) { return confirm("Connect " + params.sourceId + " to " + params.targetId + "?"); }

});

But somehow this does not work. Any tips how I can modify this demo to get a dialog to come up before the connection is established?

Thanks in advance,

Chris R.

Simon Porritt

unread,
Mar 2, 2012, 4:48:56 PM3/2/12
to jsp...@googlegroups.com
This looks like it should work; did you get that beforeDrop code from
the draggable connectors demo? The only difference between that one
and this is that here you're using makeTarget, so it makes me a bit
suspicious that there could be a bug here.

Do you think you could possibly put together a jsFiddle for this?
You can use this jsPlumb :

http://jsplumb.org/js/jquery.jsPlumb-1.3.6-all.js

Simon

--
Simon Porritt

+61 (0) 459 762 779

Chris R.

unread,
Mar 2, 2012, 5:48:24 PM3/2/12
to jsp...@googlegroups.com
Hi Simon,

Here is the jsFiddle:


Yep, I took the beforeDrop line from the draggable connectors demo which uses it in the addEndpoint call.
But in my case I would like to use it with makeTarget since what I'm trying to do is very similar to the state machine demo.

Thanks for your help,

Chris R.

On Friday, March 2, 2012 1:48:56 PM UTC-8, simon....@gmail.com wrote:
This looks like it should work; did you get that beforeDrop code from
the draggable connectors demo?  The only difference between that one
and this is that here you're using makeTarget, so it makes me a bit
suspicious that there could be a bug here.

Do you think you could possibly put together a jsFiddle for this?
You can use this jsPlumb :

http://jsplumb.org/js/jquery.jsPlumb-1.3.6-all.js

Simon

Simon Porritt

unread,
Mar 2, 2012, 6:03:55 PM3/2/12
to jsp...@googlegroups.com
Thanks for that - I was just about write back and say that I checked
this and it's definitely a bug. Sorry to have made you put together
that fiddle.

I've fixed this in 1.3.7 now. I hope to release 1.3.7 fairly soon.

SImon

Chris R.

unread,
Mar 2, 2012, 6:22:35 PM3/2/12
to jsp...@googlegroups.com
Thanks!
Is it possible to get a hold of your changes that fixes this before 1.3.7 is released?
BTW, thanks for this very useful library!

Chris R.


On Friday, March 2, 2012 3:03:55 PM UTC-8, simon....@gmail.com wrote:
Thanks for that - I was just about write back and say that I checked
this and it's definitely a bug. Sorry to have made you put together
that fiddle.

I've fixed this in 1.3.7 now.  I hope to release 1.3.7 fairly soon.

SImon

Simon Porritt

unread,
Mar 2, 2012, 7:00:50 PM3/2/12
to jsp...@googlegroups.com

You can always build a copy from the source, if you have ant installed:

ant -Dversion=1.3.7-RC1

It ends up in build/1.3.7/js.

On 03/03/2012 10:22 AM, "Chris R." <cre...@yahoo.com> wrote:
Thanks!

Is it possible to get a hold of your changes that fixes this before 1.3.7 is released?
BTW, thanks for this very useful library!

Chris R.


On Friday, March 2, 2012 3:03:55 PM UTC-8, simon....@gmail.com wrote:


>
> Thanks for that - I was just about write back and say that I checked

> this and it's definitely...


>
> On Sat, Mar 3, 2012 at 9:48 AM, Chris R. wrote:
> > Hi Simon,
> >
> > Here is the jsFiddle:

> >...

Reply all
Reply to author
Forward
0 new messages