Skip to content

Commit

Permalink
Build for release
Browse files Browse the repository at this point in the history
  • Loading branch information
maxkfranz committed Feb 7, 2023
1 parent dee1026 commit 7b0595a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


Copyright (c) 2016-2021, The Cytoscape Consortium.
Copyright (c) 2016-2021, 2023, The Cytoscape Consortium.

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the “Software”), to deal in
Expand Down
18 changes: 17 additions & 1 deletion cytoscape-cxtmenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,7 @@ var cxtmenu = function cxtmenu(params) {
var panEnabled = void 0;
var boxEnabled = void 0;
var gestureStartEvent = void 0;
var hoverOn = void 0;

var restoreZoom = function restoreZoom() {
if (zoomEnabled) {
Expand Down Expand Up @@ -626,7 +627,17 @@ var cxtmenu = function cxtmenu(params) {
theta2 += dtheta;
}
queueDrawCommands(rx, ry, r, theta, rs);
}).on('tapdrag', dragHandler).on('cxttapend tapend', function () {
}).on('tapdrag', dragHandler).on('mousemove', function () {
if (activeCommandI !== undefined) {
var hovered = commands[activeCommandI].hover;
if (hovered) {
if (hoverOn !== activeCommandI) {
hovered.apply(target, [target, gestureStartEvent]);
}
hoverOn = activeCommandI;
}
}
}).on('cxttapend tapend', function () {
parent.style.display = 'none';
if (activeCommandI !== undefined) {
var select = commands[activeCommandI].select;
Expand All @@ -637,6 +648,8 @@ var cxtmenu = function cxtmenu(params) {
}
}

hoverOn = undefined;

inGesture = false;

restoreGestures();
Expand Down Expand Up @@ -721,6 +734,9 @@ var defaults = {
fillColor: 'rgba(200, 200, 200, 0.75)', // optional: custom background color for item
content: 'a command name' // html/text content to be displayed in the menu
contentStyle: {}, // css key:value pairs to set the command's css in js if you want
hover: function(ele){ // a function to execute when the command is hovered
console.log( ele.id() ) // `ele` holds the reference to the active element
},
select: function(ele){ // a function to execute when the command is selected
console.log( ele.id() ) // `ele` holds the reference to the active element
},
Expand Down

0 comments on commit 7b0595a

Please sign in to comment.