return true;
});
- $(document).on('click', ':not(a)', function () {
- var selector = '#background,header,footer';
- if (!$(this).is(selector) && $(this).closest(selector).length == 0) {
+ if (this.autoHideArrows()) {
+ $(document).on('click', ':not(a)', function () {
+ var selector = '#background,header,footer';
+ if (!$(this).is(selector) && $(this).closest(selector).length == 0) {
+ return true;
+ }
+ $this.toggleInterface();
return true;
- }
- $this.toggleInterface();
- return true;
- });
+ });
+ }
$(this.fluidbook).on('fluidbook.ready', function () {
setTimeout(function () {
if (!$(page).hasClass(position)) {
if (position == 'left') {
$(page).removeClass('right');
- }
- else {
+ } else {
$(page).removeClass('left');
}
$(page).addClass(position);
}).addClass('img');
return $(div).get(0).outerHTML;
},
- loadImage: function (src, width, height, type, callback) {
- if (src == false) {
- callback();
- return;
- }
- var img = new Image();
+ loadImage: function (src, width, height, type, cb) {
var $this = this;
- var callbackCalled = false;
- if (callback && typeof callback == 'function') {
- $(img).one('load', function () {
+ var callback = function () {
+ if (cb && typeof cb == 'function') {
setTimeout(function () {
if (!callbackCalled) {
callbackCalled = true;
- callback();
+ cb();
}
- }, 10);
- });
+ }, 10)
+ }
+ setTimeout(function () {
+ $this.fluidbook.executeWhenNetwork(function () {
+ $("#loadedcontents").find('[src="' + src + '"]').remove();
+ });
+ }, 30000);
+ }
+
+ if (src === false) {
+ callback();
+ return;
}
- $(img).on('error', function () {
+ var img = new Image();
+ var $this = this;
+ var callbackCalled = false;
+
+ $(img).one('load', function () {
+ callback();
+ });
+
+ $(img).one('error', function () {
$this.imagesErrors.push(this);
- setTimeout(function () {
- callback();
- }, 10);
+ callback();
});
img.src = src;
- if (width != undefined && width != null) {
+ if (width !== undefined && width !== null) {
img.width = width;
}
- if (height != undefined && height != null) {
+ if (height !== undefined && height !== null) {
img.height = height;
}
- if (type != undefined && type != null) {
+ if (type !== undefined && type !== null) {
img.type = type;
}
- if (callback && typeof callback == 'function' && (img.complete || img.readyState == 'complete' || img.readyState == 4)) {
- setTimeout(function () {
- if (!callbackCalled) {
- callbackCalled = true;
- callback();
- }
- }, 10);
+ if (img.complete || img.readyState === 'complete' || img.readyState === 4) {
+ callback();
}
- return $(img);
+ var res = $(img);
+ $("#loadedcontents").append(res);
+ return res;
},
retryErrorImages: function () {
$(this.imagesErrors).each(function () {