cytoscape-edgehandles
Advanced tools
Comparing version 2.11.1 to 2.12.0
@@ -198,5 +198,6 @@ /*! | ||
// fired when edgehandles interaction is stopped (either complete with added edges or incomplete) | ||
}, | ||
cancel: function( sourceNode, renderedPosition ) { | ||
// fired when edgehandles are cancelled ( incomplete - nothing has been added ) - renderedPosition is where the edgehandle was released | ||
}, | ||
cancel: function( sourceNode, renderedPosition, invalidTarget ) { | ||
// fired when edgehandles are cancelled ( incomplete - nothing has been added ) - renderedPosition is where the edgehandle was released, invalidTarget is | ||
// a collection on which the handle was released, but which for other reasons (loopAllowed | edgeType) is an invalid target | ||
} | ||
@@ -426,2 +427,3 @@ }; | ||
.removeClass( 'edgehandles-source' ) | ||
.removeClass( 'edgehandles-presumptive-target') | ||
.removeClass( 'edgehandles-target' ); | ||
@@ -591,4 +593,5 @@ | ||
if( source.size() === 0 || targets.size() === 0 ) { | ||
options().cancel(source, {x: mx, y: my}); | ||
source.trigger( 'cyedgehandles.cancel', {x: mx, y: my}); | ||
var presumptiveTarget = cy.nodes( '.edgehandles-presumptive-target' ); | ||
options().cancel(source, {x: mx, y: my}, presumptiveTarget); | ||
source.trigger( 'cyedgehandles.cancel', [{x: mx, y: my}, presumptiveTarget]); | ||
return; // nothing to do :( | ||
@@ -601,3 +604,2 @@ } | ||
added = cy.elements( '.edgehandles-preview' ).removeClass( 'edgehandles-preview' ); | ||
options().complete( source, targets, added ); | ||
@@ -696,2 +698,5 @@ source.trigger( 'cyedgehandles.complete' ); | ||
node.addClass('edgehandles-presumptive-target'); | ||
if( isGhost || noEdge ) { | ||
@@ -727,2 +732,4 @@ return; | ||
node.removeClass( 'edgehandles-target' ); | ||
node.removeClass( 'edgehandles-presumptive-target' ); | ||
removePreview( source, target ); | ||
@@ -729,0 +736,0 @@ } |
{ | ||
"name": "cytoscape-edgehandles", | ||
"version": "2.11.1", | ||
"version": "2.12.0", | ||
"description": "Edge creation extension for Cytoscape.js", | ||
@@ -5,0 +5,0 @@ "main": "cytoscape-edgehandles.js", |
@@ -103,5 +103,6 @@ cytoscape-edgehandles | ||
// fired when edgehandles interaction is stopped (either complete with added edges or incomplete) | ||
}, | ||
cancel: function( sourceNode, renderedPosition ) { | ||
// fired when edgehandles are cancelled ( incomplete - nothing has been added ) - renderedPosition is where the edgehandle was released | ||
}, | ||
cancel: function( sourceNode, renderedPosition, invalidTarget ){ | ||
// fired when edgehandles are cancelled ( incomplete - nothing has been added ) - renderedPosition is where the edgehandle was released, invalidTarget is | ||
// a collection on which the handle was released, but which for other reasons (loopAllowed | edgeType) is an invalid target | ||
} | ||
@@ -123,2 +124,3 @@ }; | ||
* `edgehandles-ghost-edge` : The ghost handle line edge | ||
* `edgehandles-presumptive-target` : A node that, during an edge drag, may become a target when released | ||
@@ -136,3 +138,3 @@ | ||
* `cyedgehandles.complete` : when the handle has been released and edges are created | ||
* `cyedgehandles.cancel` : when the handle has been released but not on a valid target. The renderedPosition where the handle as releases is available as an extra paramater to the listener. | ||
* `cyedgehandles.cancel` : when the handle has been released but not on a valid target. The handler receives two arguments - the renderedPosition at which the handle was released and a collection of presumptive targets. Presumptive targets are nodes that would have become targets but were, for some reason, deemed invalid. Possible reasons include `edgeType` or `loopAllowed` returning null. | ||
@@ -139,0 +141,0 @@ On the target node: |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
87664
1048
175