cytoscape
Advanced tools
Comparing version 2.7.14 to 2.7.15
/*! | ||
Cytoscape.js 2.7.14 (MIT licensed) | ||
Cytoscape.js 2.7.15 (MIT licensed) | ||
@@ -6,0 +6,0 @@ Copyright (c) The Cytoscape Consortium |
{ | ||
"name": "cytoscape", | ||
"version": "2.7.14", | ||
"version": "2.7.15", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "Graph theory (a.k.a. network) library for analysis and visualisation", |
@@ -20,5 +20,32 @@ 'use strict'; | ||
var on = function(){ | ||
var args = arguments; | ||
var tgtIsDom = tgt === window || tgt === document || tgt === document.body || is.domElement( tgt ); | ||
if( r.supportsPassiveEvents == null ){ | ||
// from https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md#feature-detection | ||
var supportsPassive = false; | ||
try { | ||
var opts = Object.defineProperty( {}, 'passive', { | ||
get: function(){ | ||
supportsPassive = true; | ||
} | ||
} ); | ||
window.addEventListener( 'test', null, opts ); | ||
} catch( err ){} | ||
r.supportsPassiveEvents = supportsPassive; | ||
} | ||
var on = function( event, handler, useCapture ){ | ||
var args = Array.prototype.slice.call( arguments ); | ||
if( tgtIsDom && r.supportsPassiveEvents ){ // replace useCapture w/ opts obj | ||
args[2] = { | ||
capture: useCapture != null ? useCapture : false, | ||
passive: false, | ||
once: false | ||
}; | ||
} | ||
r.bindings.push({ | ||
@@ -25,0 +52,0 @@ target: tgt, |
@@ -32,3 +32,3 @@ 'use strict'; | ||
// replaced by build system | ||
cytoscape.version = require('./version.json'); | ||
cytoscape.version = require('./version'); | ||
@@ -35,0 +35,0 @@ // try to register w/ jquery |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
4323242
43703