Browse Source

- Improved images handling so broken images are shown on all references of images that are broken.

v3_develop
Alex de Mulder 10 years ago
parent
commit
42fd92f959
3 changed files with 2147 additions and 2128 deletions
  1. +1
    -0
      HISTORY.md
  2. +2128
    -2119
      dist/vis.js
  3. +18
    -9
      lib/network/Images.js

+ 1
- 0
HISTORY.md View File

@ -7,6 +7,7 @@ http://visjs.org
### Network
- Added option bindToWindow (default true) to choose whether the keyboard binds are global or to the network div.
- Improved images handling so broken images are shown on all references of images that are broken.
### DataSet

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


+ 18
- 9
lib/network/Images.js View File

@ -52,16 +52,25 @@ Images.prototype.load = function(url, brokenUrl) {
me.callback(this);
}
}
else if (me.imageBroken[url] === true) {
console.error("Could not load brokenImage:", brokenUrl);
delete this.src;
if (me.callback) {
me.callback(this);
}
}
else {
this.src = brokenUrl;
me.imageBroken[url] = true;
if (me.imageBroken[url] === true) {
if (this.src == brokenUrl) {
console.error("Could not load brokenImage:", brokenUrl);
delete this.src;
if (me.callback) {
me.callback(this);
}
}
else {
console.error("Could not load image:", url);
this.src = brokenUrl;
}
}
else {
console.error("Could not load image:", url);
this.src = brokenUrl;
me.imageBroken[url] = true;
}
}
};

Loading…
Cancel
Save