image preloader now only loads one image at a time
This commit is contained in:
parent
bf3ac53ddb
commit
fcec1e21e4
1 changed files with 3 additions and 2 deletions
|
@ -136,13 +136,13 @@ function ComicBook(id, srcs, opts) {
|
||||||
|
|
||||||
var page = new Image();
|
var page = new Image();
|
||||||
|
|
||||||
console.info("starting to load: " + srcs[i]);
|
// console.log("starting to load: " + srcs[i]);
|
||||||
|
|
||||||
page.src = srcs[i];
|
page.src = srcs[i];
|
||||||
|
|
||||||
page.onload = function () {
|
page.onload = function () {
|
||||||
|
|
||||||
console.info("loaded: " + srcs[i]);
|
// console.info("loaded: " + srcs[i]);
|
||||||
|
|
||||||
pages[i] = this;
|
pages[i] = this;
|
||||||
loaded += 1;
|
loaded += 1;
|
||||||
|
@ -155,6 +155,7 @@ function ComicBook(id, srcs, opts) {
|
||||||
|
|
||||||
// start rendering the comic when the buffer level has been reached
|
// start rendering the comic when the buffer level has been reached
|
||||||
if (loaded === buffer + 1) { ComicBook.prototype.drawPage(); }
|
if (loaded === buffer + 1) { ComicBook.prototype.drawPage(); }
|
||||||
|
if (loaded === srcs.length) { /* console.log("all loaded"); */ }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue