cytoscape-context-menus
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -46,2 +46,3 @@ ;(function($$, $){ 'use strict'; | ||
var eventCyTapStart; | ||
var active = false; | ||
@@ -242,3 +243,3 @@ // Merge default options with the ones coming from parameter | ||
function destroyCxtMenu() { | ||
if(!$cxtMenu) { | ||
if(!active) { | ||
return; | ||
@@ -253,2 +254,3 @@ } | ||
$cxtMenu = undefined; | ||
active = false; | ||
} | ||
@@ -329,5 +331,9 @@ | ||
// Clear old context menu | ||
destroyCxtMenu(); | ||
// Clear old context menu if needed | ||
if(active) { | ||
destroyCxtMenu(); | ||
} | ||
active = true; | ||
$cxtMenu = createAndAppendCxtMenuComponent(); | ||
@@ -344,2 +350,9 @@ | ||
// Returns whether the extension is active | ||
cytoscape('core', 'isContextMenusActive', function () { | ||
cy = this; | ||
return active; | ||
}); | ||
// Appends given menu item to the menu items list. | ||
@@ -346,0 +359,0 @@ cytoscape('core', 'appendMenuItem', function (item) { |
{ | ||
"name": "cytoscape-context-menus", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "A Cytoscape.js extension to provide context menu around elements and core instance.", | ||
@@ -5,0 +5,0 @@ "main": "cytoscape-context-menus.js", |
@@ -95,2 +95,5 @@ cytoscape-context-menus | ||
`cy.isContextMenusActive()` | ||
Returns whether the extension is active. | ||
`cy.appendMenuItem(item)` | ||
@@ -97,0 +100,0 @@ Appends given menu item to the menu items list. |
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
41408
489
136