cytoscape-context-menus
Advanced tools
Comparing version 3.0.7 to 3.1.0
@@ -10,2 +10,5 @@ ;(function(){ 'use strict'; | ||
var defaults = { | ||
// Customize event to bring up the context menu | ||
// Possible options https://js.cytoscape.org/#events/user-input-device-events | ||
evtType: 'cxttap', | ||
// List of initial menu items | ||
@@ -162,5 +165,5 @@ menuItems: [ | ||
var cxtCoreFcn; | ||
if(coreAsWell) { | ||
cy.on('cxttap', cxtCoreFcn = function(event) { | ||
cy.on(options.evtType, cxtCoreFcn = function(event) { | ||
var target = event.target || event.cyTarget; | ||
@@ -176,3 +179,3 @@ if( target != cy ) { | ||
if(selector) { | ||
cy.on('cxttap', selector, cxtfcn = function(event) { | ||
cy.on(options.evtType, selector, cxtfcn = function(event) { | ||
_cxtfcn(event); | ||
@@ -367,9 +370,9 @@ }); | ||
var cxtCoreFcn = $component.data('cy-context-menus-cxtcorefcn'); | ||
if(cxtfcn) { | ||
cy.off('cxttap', selector, cxtfcn); | ||
cy.off(options.evtType, selector, cxtfcn); | ||
} | ||
if(cxtCoreFcn) { | ||
cy.off('cxttap', cxtCoreFcn); | ||
cy.off(options.evtType, cxtCoreFcn); | ||
} | ||
@@ -376,0 +379,0 @@ |
{ | ||
"name": "cytoscape-context-menus", | ||
"version": "3.0.7", | ||
"version": "3.1.0", | ||
"description": "A Cytoscape.js extension to provide context menu around elements and core instance.", | ||
@@ -5,0 +5,0 @@ "main": "cytoscape-context-menus.js", |
@@ -11,2 +11,6 @@ cytoscape-context-menus | ||
Please cite the following paper when using this extension: | ||
U. Dogrusoz , A. Karacelik, I. Safarli, H. Balci, L. Dervishi, and M.C. Siper, "[Efficient methods and readily customizable libraries for managing complexity of large networks](https://doi.org/10.1371/journal.pone.0197238)", PLoS ONE, 13(5): e0197238, 2018. | ||
## Demo | ||
@@ -66,2 +70,5 @@ | ||
var options = { | ||
// Customize event to bring up the context menu | ||
// Possible options https://js.cytoscape.org/#events/user-input-device-events | ||
evtType: 'cxttap', | ||
// List of initial menu items | ||
@@ -68,0 +75,0 @@ menuItems: [/* |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
70798
17
581
174
2