},
addCLinks: function (pageNr) {
- var $this=this;
+ var $this = this;
var page = $("#page_" + pageNr);
$.each(['clinks', 'ctlinks'], function (k, cont) {
var normal = $(page).children('.' + cont + '[data-blendmode="normal"]');
this.backgrounds[page] = this.loadImage(url, null, null, null, page, callback);
},
needSeparateTextures: function (page) {
- return this.fluidbook.settings.clinks[page].indexOf('data-animation-hide') >= 0 ||
- this.fluidbook.settings.clinks[page].indexOf('data-animation-hide-on-leave') >= 0;
+ if (this._needSeparateTextures[page] === undefined) {
+ var $this = this;
+ this._needSeparateTextures[page] = false;
+ $.each(this.fluidbook.settings.clinks[page], function (blendmode, links) {
+ $.each(links, function (k, link) {
+ if (link.indexOf('data-animation-hide') >= 0 || link.indexOf('data-animation-hide-on-leave') >= 0) {
+ $this._needSeparateTextures[page] = true;
+ return false;
+ }
+ });
+ if ($this._needSeparateTextures[page]) {
+ return false;
+ }
+ });
+ }
+ return this._needSeparateTextures[page];
},
loadTexture: function (page, callback, enter) {
if (enter === undefined) {
_preloadContentLinkTextures: function (page, clinks, enter, callback) {
var textures = {};
- if (clinks === '') {
+
+ var cl = '';
+ $.each(clinks, function (blendmode, links) {
+ cl += links.join('');
+ });
+
+ if (cl === '') {
callback(textures);
return;
}
- $("body").append('<div class="texture_clinks" data-page="' + page + '">' + clinks + '</div>');
+ $("body").append('<div class="texture_clinks" data-page="' + page + '">' + cl + '</div>');
var loaded = 0;
var nb = 0;
}
var $this = this;
var clinks = this.handleExtension(this.fluidbook.settings.clinks[page]);
+
this._preloadContentLinkTextures(page, clinks, enter, function (textures) {
var d = 1024;
var c = document.getElementById("pscanvas");