Skip to content

Commit

Permalink
Merge branch 'jquery3-compatibility' of https://github.com/nicky1038/…
Browse files Browse the repository at this point in the history
…cytoscape.js-qtip into nicky1038-jquery3-compatibility
  • Loading branch information
maxkfranz committed Oct 22, 2019
2 parents a4a5179 + b27b6af commit 255a196
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions cytoscape-qtip.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ SOFTWARE.
}
};

var fixDomContainer = function(ele) {
return ele && ( ele[0] === window ) ? undefined : ele;
};

var throttle = function(func, wait, options) {
var leading = true,
trailing = true;
Expand Down Expand Up @@ -196,8 +200,8 @@ SOFTWARE.

// qtip should be positioned relative to cy dom container
opts.position = opts.position || {};
opts.position.container = opts.position.container || $( document.body );
opts.position.viewport = opts.position.viewport || $( document.body );
opts.position.container = fixDomContainer(opts.position.container) || $( document.body );
opts.position.viewport = fixDomContainer(opts.position.viewport) || $( document.body );
opts.position.target = [0, 0];
opts.position.my = opts.position.my || 'top center';
opts.position.at = opts.position.at || 'bottom center';
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"run-sequence": "^1.0.0"
},
"dependencies": {
"jquery": "^2.0 || ^1.10.0",
"jquery": "^3.0.0 || ^2.0 || ^1.10.0",
"qtip2": "^3.0 || ^2.2.0"
},
"peerDependencies": {
Expand Down

0 comments on commit 255a196

Please sign in to comment.