]> _ Git - fluidbook-html5.git/commitdiff
fix #2076 @0:10
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 31 May 2018 13:48:58 +0000 (15:48 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 31 May 2018 13:48:58 +0000 (15:48 +0200)
js/libs/fluidbook/fluidbook.js
js/libs/fluidbook/fluidbook.nav.js

index 22cab9d815af6fbc0b3276f8f54987d8cdc6adc9..7f2fa5ee7c98f376fb321f40f1f2f76dc2db4f30 100644 (file)
@@ -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 {
index aae0c5829273e21afceb3db50513103f54cb1b5d..8a0d68e1616cc937358ca29437358eb2f954864a 100644 (file)
@@ -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');