Browse Source

Fixed infinite loop on network image load when Url and brokenUrl failed to load

v3_develop
Brendon Page 9 years ago
parent
commit
1321df719a
4 changed files with 5382 additions and 5459 deletions
  1. +5355
    -5447
      dist/vis.js
  2. +1
    -1
      dist/vis.map
  3. +11
    -11
      dist/vis.min.js
  4. +15
    -0
      lib/network/Images.js

+ 5355
- 5447
dist/vis.js
File diff suppressed because it is too large
View File


+ 1
- 1
dist/vis.map
File diff suppressed because it is too large
View File


+ 11
- 11
dist/vis.min.js
File diff suppressed because it is too large
View File


+ 15
- 0
lib/network/Images.js View File

@ -7,6 +7,14 @@ function Images() {
this.callback = undefined;
}
Images.prototype._resolveRelativeUrl = function(url){
var img = document.createElement('img');
img.src = url; // set string url
url = img.src; // get qualified url
img.src = null; // no server request
return url;
}
/**
* Set an onload callback function. This will be called each time an image
* is loaded
@ -52,6 +60,13 @@ Images.prototype.load = function(url, brokenUrl) {
me.callback(this);
}
}
else if (this.src === me._resolveRelativeUrl(brokenUrl)){
console.error("Could not load brokenImage:", brokenUrl);
delete this.src;
if (me.callback) {
me.callback(this);
}
}
else {
this.src = brokenUrl;
}

Loading…
Cancel
Save