Skip to content

Commit

Permalink
Build for release
Browse files Browse the repository at this point in the history
  • Loading branch information
maxkfranz committed Apr 2, 2019
1 parent d115d2c commit 9d1bec0
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 43 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-2018, The Cytoscape Consortium.
Copyright (c) 2016-2019, 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
96 changes: 54 additions & 42 deletions cytoscape-cxtmenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -458,65 +458,77 @@ var cxtmenu = function cxtmenu(params) {
}

if (typeof options.commands === 'function') {
commands = options.commands(target);
var res = options.commands(target);
if (res.then) {
res.then(function (_commands) {
commands = _commands;
openMenu();
});
} else {
commands = res;
openMenu();
}
} else {
commands = options.commands;
openMenu();
}

if (!commands || commands.length === 0) {
return;
}
function openMenu() {
if (!commands || commands.length === 0) {
return;
}

zoomEnabled = cy.userZoomingEnabled();
cy.userZoomingEnabled(false);
zoomEnabled = cy.userZoomingEnabled();
cy.userZoomingEnabled(false);

panEnabled = cy.userPanningEnabled();
cy.userPanningEnabled(false);
panEnabled = cy.userPanningEnabled();
cy.userPanningEnabled(false);

boxEnabled = cy.boxSelectionEnabled();
cy.boxSelectionEnabled(false);
boxEnabled = cy.boxSelectionEnabled();
cy.boxSelectionEnabled(false);

grabbable = target.grabbable && target.grabbable();
if (grabbable) {
target.ungrabify();
}
grabbable = target.grabbable && target.grabbable();
if (grabbable) {
target.ungrabify();
}

var rp = void 0,
rw = void 0,
rh = void 0;
if (!isCy && ele.isNode() && !ele.isParent() && !options.atMouse) {
rp = ele.renderedPosition();
rw = ele.renderedWidth();
rh = ele.renderedHeight();
} else {
rp = e.renderedPosition || e.cyRenderedPosition;
rw = 1;
rh = 1;
}
var rp = void 0,
rw = void 0,
rh = void 0;
if (!isCy && ele.isNode() && !ele.isParent() && !options.atMouse) {
rp = ele.renderedPosition();
rw = ele.renderedWidth();
rh = ele.renderedHeight();
} else {
rp = e.renderedPosition || e.cyRenderedPosition;
rw = 1;
rh = 1;
}

offset = getOffset(container);
offset = getOffset(container);

ctrx = rp.x;
ctry = rp.y;
ctrx = rp.x;
ctry = rp.y;

createMenuItems();
createMenuItems();

setStyles(parent, {
display: 'block',
left: rp.x - r + 'px',
top: rp.y - r + 'px'
});
setStyles(parent, {
display: 'block',
left: rp.x - r + 'px',
top: rp.y - r + 'px'
});

rs = Math.max(rw, rh) / 2;
rs = Math.max(rs, options.minSpotlightRadius);
rs = Math.min(rs, options.maxSpotlightRadius);
rs = Math.max(rw, rh) / 2;
rs = Math.max(rs, options.minSpotlightRadius);
rs = Math.min(rs, options.maxSpotlightRadius);

queueDrawBg();
queueDrawBg();

activeCommandI = undefined;
activeCommandI = undefined;

inGesture = true;
gestureStartEvent = e;
inGesture = true;
gestureStartEvent = e;
}
}).on('cxtdrag tapdrag', options.selector, dragHandler = function dragHandler(e) {

if (!inGesture) {
Expand Down

0 comments on commit 9d1bec0

Please sign in to comment.