},
checkLoadedThumbs: function () {
+ let $this = this;
+ $.each(this.thumbnails, function (page, img) {
+ if (img === undefined || img === null || $this.loadedThumbnails.indexOf(page) >= 0) {
+ return;
+ }
+ img = $(img).get(0);
+
+ if (img.complete || img.readyState === 'complete' || img.readyState === 4) {
+ $this.loadedThumbnails.push(page);
+ }
+ });
return this.loadedThumbnails.length === this.fluidbook.settings.pages;
},
for (var i = 1; i <= this.fluidbook.settings.pages; i++) {
this.loadThumb(i, cb);
}
+
},
loadThumb: function (pageNr, callback) {
return;
}
var $this = this;
- var cb = function () {
- $this.loadedThumbnails.push(pageNr);
+ let cb = function () {
+ if ($this.loadedThumbnails.indexOf(pageNr) === -1) {
+ $this.loadedThumbnails.push(pageNr);
+ }
if ($this.checkLoadedThumbs()) {
$($this).trigger('thumbnails.loaded');
}
callbackCalled = true;
cb(img);
}
- }, $this.fluidbook.shortLoading ? 0 : 10);
+ }, $this.fluidbook.shortLoading ? 4 : 10);
}
}
clearInterval(interval);
callback(img);
}
- }, $this.fluidbook.shortLoading ? 0 : 100);
+ }, $this.fluidbook.shortLoading ? 4 : 100);
}
});
},
openIndex: function (title, group, closeAll, callback) {
+ console.log('openIndex');
var $this = this;
this.fluidbook.displayLoader();
this.preloadThumbs(function () {
},
_openIndex: function (title, group, closeAll, callback) {
+ console.log('_openIndex');
var c = !closeAll ? ' one' : '';
var index = this.fluidbook.menu.getCaption(title);
index += this.getView(group);