|
|
@ -236,7 +236,7 @@ function Network (container, data, options) { |
|
|
|
var network = this; |
|
|
|
this.groups = new Groups(); // object with groups
|
|
|
|
this.images = new Images(); // object with images
|
|
|
|
this.images.setOnloadCallback(function () { |
|
|
|
this.images.setOnloadCallback(function (status) { |
|
|
|
network._redraw(); |
|
|
|
}); |
|
|
|
|
|
|
@ -350,16 +350,19 @@ function Network (container, data, options) { |
|
|
|
// Extend Network with an Emitter mixin
|
|
|
|
Emitter(Network.prototype); |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* Determine if the browser requires a setTimeout or a requestAnimationFrame. This was required because |
|
|
|
* some implementations (safari and IE9) did not support requestAnimationFrame |
|
|
|
* @private |
|
|
|
*/ |
|
|
|
Network.prototype._determineBrowserMethod = function() { |
|
|
|
var ua = navigator.userAgent.toLowerCase(); |
|
|
|
|
|
|
|
var browserType = navigator.userAgent.toLowerCase(); |
|
|
|
this.requiresTimeout = false; |
|
|
|
if (ua.indexOf('msie 9.0') != -1) { // IE 9
|
|
|
|
if (browserType.indexOf('msie 9.0') != -1) { // IE 9
|
|
|
|
this.requiresTimeout = true; |
|
|
|
} |
|
|
|
else if (ua.indexOf('safari') != -1) { // safari
|
|
|
|
if (ua.indexOf('chrome') <= -1) { |
|
|
|
else if (browserType.indexOf('safari') != -1) { // safari
|
|
|
|
if (browserType.indexOf('chrome') <= -1) { |
|
|
|
this.requiresTimeout = true; |
|
|
|
} |
|
|
|
} |
|
|
|