Skip to content
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

Scopes not applied to new drag & drop connections (fix included) #841

Closed
dbnoble opened this issue Jan 21, 2016 · 2 comments
Closed

Scopes not applied to new drag & drop connections (fix included) #841

dbnoble opened this issue Jan 21, 2016 · 2 comments
Labels

Comments

@dbnoble
Copy link

dbnoble commented Jan 21, 2016

@sporritt - Scopes for draggable connections have been broken for some time now. Unless there was some specific, intentional reason this stopped working, it's a very easy fix.

Example: https://jsplumbtoolkit.com/community/demo/draggableConnectors/ should reflect scopes blue, yellow, and green, however they all return jsPlumb_DefaultScope instead.

This block in endpoint.js is the culprit, the scope is not being passed in from params. We need to add scope: params.scope to the object for it to work again.

jpc = _newConnection({
                            sourceEndpoint: this,
                            targetEndpoint: this._jsPlumb.floatingEndpoint,
                            source: this.element,  // for makeSource with parent option.  ensure source element is represented correctly.
                            target: placeholderInfo.element,
                            anchors: [ this.anchor, this._jsPlumb.floatingEndpoint.anchor ],
                            paintStyle: params.connectorStyle, // this can be null. Connection will use the default.
                            hoverPaintStyle: params.connectorHoverStyle,
                            connector: params.connector, // this can also be null. Connection will use the default.
                            overlays: params.connectorOverlays,
                            type: this.connectionType,
                            cssClass: this.connectorClass,
                            hoverClass: this.connectorHoverClass,
                            data:beforeDrag
                        });

Here is the exact location: https://github.com/sporritt/jsPlumb/blob/master/src/endpoint.js#L593-L607

If you'd like a pull request let me know.

@sporritt
Copy link
Member

thanks, i will take a look at this shortly.

sporritt referenced this issue in jsplumb/jsplumb Jan 23, 2016
@sporritt
Copy link
Member

fixed. i had to add it in another place too for the programmatic connect(...) call. thanks.

@sporritt sporritt transferred this issue from jsplumb/jsplumb Oct 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants