-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Before Drop event called AFTER Connection Moved event #89
Comments
Up ? |
does the before drop interceptor not have the information you need in order to determine whether or not the drop should be allowed? |
Hi, I've searched a lot and couldn't tell to differentiate if the connection was moved or created. But now I've tried using "maxConnection" when setting up endpoints, but I couldn't find out what event was fired (e.g. to replace the connection or alert the user), and the docs don't say much a lot about max connections. Am I being clear in my explanations ? |
"And I can't tell if the drop should be allowed because the connection is already created! "var.lenght" returns 2 and not 1" I don't mean to be flippant but can you not just test for |
No :( Is there any way of knowing whether the connection affected by the event already exists or is created by this action ? |
Hi 👋,
I need help as explained in the title.
I need to do some checks BEFORE the connection is dropped, for example : "Check if the two elements (source and target) are already connected ?"
How I proceed :
Call instance.getConnections({}, true) between the source and target. Place result in a var.
Check if var.lenght > 0 then a connection between the two elements already exists.
But it can't work because (and I checked) the EVENT_CONNECTION_MOVED is firered BEFORE INTERCEPT_BEFORE_DROP.
I need multiple connections enabled but not multiple between two same endpoints.
Do you have any ideas or did the event fire order needs to be changed ?
Thank's
Edit: I'm using the 6.0.5 version of JSPlumb
The text was updated successfully, but these errors were encountered: