From: Vincent Vanwaelscappel Date: Thu, 31 May 2018 13:48:58 +0000 (+0200) Subject: fix #2076 @0:10 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=724e369d13755f4041dde9e0caba605534501be6;p=fluidbook-html5.git fix #2076 @0:10 --- diff --git a/js/libs/fluidbook/fluidbook.js b/js/libs/fluidbook/fluidbook.js index 22cab9d8..7f2fa5ee 100644 --- a/js/libs/fluidbook/fluidbook.js +++ b/js/libs/fluidbook/fluidbook.js @@ -25,7 +25,9 @@ Fluidbook.prototype = { init: function (datas) { this.datas = datas; this.junk = datas.cacheDate; - this.landingpage = new FluidbookLandingPage(this); + if (this.datas.landingPage != undefined && this.datas.landingPage != '') { + this.landingpage = new FluidbookLandingPage(this); + } this.menu = new FluidbookMenu(this); this.zoom = new FluidbookZoom(this); this.zoom.resetZoom(); @@ -54,8 +56,9 @@ Fluidbook.prototype = { this.tooltip = new FluidbookTooltip(this); this.audiodescription = new FluidbookAudioDescription(this); this.sound = new FluidbookSound(this); - this.cart =new FluidbookCart(this); - + if(this.datas.basket) { + this.cart = new FluidbookCart(this); + } if (this.datas.form == 'bulle') { this.form = new FluidbookBulleForm(this); } else { @@ -309,7 +312,7 @@ Fluidbook.prototype = { var args = window.location.hash.split('/'); if (args.length <= 1 || args[1] == '' || args[1] == undefined) { - if (this.landingpage.hasLandingPage) { + if (this.landingpage!==undefined && this.landingpage.hasLandingPage) { window.location.hash = '/landing'; return; } @@ -333,7 +336,9 @@ Fluidbook.prototype = { if (page != $this.currentPage) { $($this).trigger('changePage', [page]); } - this.landingpage.hide(); + if(this.landingpage!==undefined) { + this.landingpage.hide(); + } this.menu.closeView(function () { if (page != $this.currentPage) { $this.pageTransition(page); @@ -346,7 +351,9 @@ Fluidbook.prototype = { else if (args[1] == 'landing') { $this.hideSplash(); - this.landingpage.show(); + if(this.landingpage!==undefined) { + this.landingpage.show(); + } } else { diff --git a/js/libs/fluidbook/fluidbook.nav.js b/js/libs/fluidbook/fluidbook.nav.js index aae0c582..8a0d68e1 100644 --- a/js/libs/fluidbook/fluidbook.nav.js +++ b/js/libs/fluidbook/fluidbook.nav.js @@ -412,7 +412,7 @@ FluidbookNav.prototype = { link = this.addLink(navType, 'nav-download', '#', 'download', 'download', 'download'); } else if (icon == 'print' && this.fluidbook.datas.print) { link = this.addLink(navType, 'nav-print', '#', 'print', 'print', 'print'); - } else if (icon == 'basket' && this.fluidbook.cart.enabled) { + } else if (icon == 'basket' && this.fluidbook.cart != undefined && this.fluidbook.cart.enabled) { link = this.addLink(navType, 'nav-basket', '#/cart', 'cart', 'basket', 'basket'); $(this.fluidbook).on('fluidbook.cart.updateIcon', {link: $(link).attr('id')}, function (e, data) { var n = data.number; @@ -427,7 +427,7 @@ FluidbookNav.prototype = { $(l).find('span.number').text(n); } }); - this.fluidbook.cart.instance.updateIcon(); + this.fluidbook.cart.instance.updateIcon(); } else if (icon == 'lang' && this.fluidbook.l10n.multilangEnabled) { // Note: the "!" at the beginning of the title/help parameters means that we don't want these strings translated link = this.addLink(navType, 'nav-locales', '#/locales', 'locales', '!' + this.fluidbook.l10n.getCurrentLanguageName(), '!Select Language');