cytoscape-edgehandles
Advanced tools
Comparing version 2.3.0 to 2.3.1
@@ -265,3 +265,3 @@ /*! | ||
var register = function( $$, $ ) { | ||
if( !cytoscape ) { | ||
if( !$$ ) { | ||
return; | ||
@@ -314,4 +314,5 @@ } // can't register if cytoscape unspecified | ||
$.fn.cytoscapeEdgehandles = function( params ) { | ||
var edgehandles = function( params, cy ) { | ||
var fn = params; | ||
var container = cy.container(); | ||
@@ -386,3 +387,2 @@ var functions = { | ||
var $container = $( this ); | ||
var cy; | ||
var $canvas = $( '<canvas></canvas>' ); | ||
@@ -815,5 +815,3 @@ var handle; | ||
$container.cytoscape( function( e ) { | ||
cy = this; | ||
cy.ready( function( e ) { | ||
lastPanningEnabled = cy.panningEnabled(); | ||
@@ -1289,5 +1287,3 @@ lastZoomingEnabled = cy.zoomingEnabled(); | ||
$container.cytoscape( function( e ) { | ||
var cy = this; | ||
cy.ready( function( e ) { | ||
cy.$( '#' + id ).trigger( 'cyedgehandles.forcestart' ); | ||
@@ -1299,18 +1295,14 @@ } ); | ||
if( functions[ fn ] ) { | ||
return functions[ fn ].apply( this, Array.prototype.slice.call( arguments, 1 ) ); | ||
return functions[ fn ].apply( container, Array.prototype.slice.call( arguments, 1 ) ); | ||
} else if( typeof fn == 'object' || !fn ) { | ||
return functions.init.apply( this, arguments ); | ||
return functions.init.apply( container, arguments ); | ||
} else { | ||
$.error( 'No such function `' + fn + '` for jquery.cytoscapeEdgeHandles' ); | ||
console.error( 'No such function `' + fn + '` for edgehandles' ); | ||
} | ||
return $( this ); | ||
}; | ||
$.fn.cyEdgehandles = $.fn.cytoscapeEdgehandles; | ||
$$( 'core', 'edgehandles', function( options ) { | ||
var cy = this; | ||
return $( cy.container() ).cytoscapeEdgehandles( options ); | ||
return edgehandles( options, cy ); | ||
} ); | ||
@@ -1317,0 +1309,0 @@ |
{ | ||
"name": "cytoscape-edgehandles", | ||
"version": "2.3.0", | ||
"version": "2.3.1", | ||
"description": "Edge creation extension for Cytoscape.js", | ||
@@ -5,0 +5,0 @@ "main": "cytoscape-edgehandles.js", |
@@ -10,3 +10,3 @@ cytoscape-edgehandles | ||
This plugin creates handles on nodes that can be dragged to create edges between nodes. | ||
This extension creates handles on nodes that can be dragged to create edges between nodes. | ||
@@ -50,3 +50,3 @@ | ||
You initialise the plugin on the same HTML DOM element container used for Cytoscape.js: | ||
You initialise the extension on the Cytoscape instance: | ||
@@ -71,3 +71,3 @@ ```js | ||
cxt: false, // whether cxt events trigger edgehandles (useful on touch) | ||
enabled: true, // whether to start the plugin in the enabled state | ||
enabled: true, // whether to start the extension in the enabled state | ||
toggleOffOnLeave: false, // whether an edge is cancelled by leaving a node (true), or whether you need to go over again to cancel (false; allows multiple edges in one pass) | ||
@@ -112,3 +112,3 @@ edgeType: function( sourceNode, targetNode ) { | ||
These classes can be used for styling the graph as it interacts with the plugin: | ||
These classes can be used for styling the graph as it interacts with the extension: | ||
@@ -124,3 +124,3 @@ * `edgehandles-source` : The source node | ||
During the course of a user's interaction with the plugin, several events are generated and triggered on the corresponding elements: | ||
During the course of a user's interaction with the extension, several events are generated and triggered on the corresponding elements: | ||
@@ -153,8 +153,8 @@ On the source node: | ||
* `cy.edgehandles('enable')` : enable the plugin | ||
* `cy.edgehandles('enable')` : disable the plugin | ||
* `cy.edgehandles('enable')` : enable the extension | ||
* `cy.edgehandles('enable')` : disable the extension | ||
* `cy.edgehandles('option', 'preview', false)` : set individual option (e.g. `'preview'`) | ||
* `cy.edgehandles('option', { /* options */ })` : set all options | ||
* `cy.edgehandles('option', 'preview')` : get option value (e.g. `'preview'`) | ||
* `cy.edgehandles('destroy')` : destroy the plugin instance | ||
* `cy.edgehandles('destroy')` : destroy the extension instance | ||
* `cy.edgehandles('start', 'some-node-id')` : start the handle drag state on node with specified id (e.g. `'some-node-id'`) | ||
@@ -161,0 +161,0 @@ * `cy.edgehandles('drawon')` : enable draw mode |
Sorry, the diff of this file is not supported yet
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
88261
1130