Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cytoscape-context-menus

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cytoscape-context-menus - npm Package Compare versions

Comparing version 2.0.3 to 2.1.0

demo-show-hide-menuitem.html

30

cytoscape-context-menus.js

@@ -42,3 +42,3 @@ ;(function(){ 'use strict';

};
var options;

@@ -134,3 +134,5 @@ var $cxtMenu;

adjustCxtMenu(event);
displayComponent($component);
if ($component.data('show')) {
displayComponent($component);
}
});

@@ -143,3 +145,5 @@ }

adjustCxtMenu(event);
displayComponent($component);
if ($component.data('show')) {
displayComponent($component);
}
});

@@ -174,3 +178,3 @@ }

var containerPos = $(cy.container()).position();
var containerPos = $(cy.container()).offset();

@@ -212,4 +216,4 @@ var left = containerPos.left + event.cyRenderedPosition.x;

$cxtMenu = $('<div id="cy-context-menus-cxt-menu" class=' + classes + '></div>');
$('body').append($cxtMenu);
return $cxtMenu;

@@ -231,4 +235,4 @@ }

$menuItemComponent.data('selector', item.selector);
$menuItemComponent.data('on-click-function', item.onClickFunction);
$menuItemComponent.data('on-click-function', item.onClickFunction);
$menuItemComponent.data('show', (typeof(item.show) === 'undefined' || item.show));
return $menuItemComponent;

@@ -376,2 +380,14 @@ }

},
// Disables the menu item with given ID.
hideMenuItem: function(itemID) {
$('#'+itemID).data('show', false);
hideComponent($('#'+itemID));
return cy;
},
// Enables the menu item with given ID.
showMenuItem: function(itemID) {
$('#'+itemID).data('show', true);
displayComponent($('#'+itemID));
return cy;
},
// Destroys the extension instance

@@ -378,0 +394,0 @@ destroy: function() {

{
"name": "cytoscape-context-menus",
"version": "2.0.3",
"version": "2.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",

@@ -7,3 +7,3 @@ cytoscape-context-menus

A Cytoscape.js extension to provide context menu around elements and core instance.
A Cytoscape.js extension to provide context menu around elements and core instance distributed under [The MIT License](https://opensource.org/licenses/MIT).

@@ -60,2 +60,3 @@ ![Image of extension](example.png)

disabled: false, // Whether the item will be created as disabled
show: false, // Whether the item will be shown or not
hasTrailingDivider: true, // Whether the item will have a trailing divider

@@ -121,2 +122,6 @@ coreAsWell: false // Whether core instance have this item on cxttap

instance.showMenuItem(itemID); // Shows the menu item with given ID.
instance.hideMenuItem(itemID); // Hides the menu item with given ID.
instance.destroy(); // Destroys the extension instance

@@ -123,0 +128,0 @@ ```

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc