From efde26f59ac89fc51e730e5a42829ff274349a6c Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Thu, 5 Jul 2018 18:30:27 +0200 Subject: [PATCH] wip #2116 --- _index.html | 1 + js/libs/fluidbook/fluidbook.js | 15 ++++++++++----- js/libs/fluidbook/fluidbook.links.js | 7 +++++++ 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/_index.html b/_index.html index db6e7c29..d7b8a9a9 100644 --- a/_index.html +++ b/_index.html @@ -4,6 +4,7 @@ + <!-- $titre --> diff --git a/js/libs/fluidbook/fluidbook.js b/js/libs/fluidbook/fluidbook.js index 5359eccc..55c9e1d4 100644 --- a/js/libs/fluidbook/fluidbook.js +++ b/js/libs/fluidbook/fluidbook.js @@ -58,7 +58,7 @@ Fluidbook.prototype = { this.sound = new FluidbookSound(this); this.slideshow = new FluidbookSlideshow(this); - if(this.datas.basket) { + if (this.datas.basket) { this.cart = new FluidbookCart(this); } if (this.datas.form == 'bulle') { @@ -313,13 +313,18 @@ Fluidbook.prototype = { var $this = this; var page; var args = window.location.hash.split('/'); + var defaultStartPage = 1; + + if (FLUIDBOOK_START_PAGE !== undefined) { + defaultStartPage = FLUIDBOOK_START_PAGE; + } if (args.length <= 1 || args[1] == '' || args[1] == undefined) { - if (this.landingpage!==undefined && this.landingpage.hasLandingPage) { + if (this.landingpage !== undefined && this.landingpage.hasLandingPage) { window.location.hash = '/landing'; return; } - return this.setCurrentPage('1'); + return this.setCurrentPage(defaultStartPage); } else if (args[1] == 'closeview') { return this.setCurrentPage(this.currentPage); } else if (args[1] == 'page') { @@ -339,7 +344,7 @@ Fluidbook.prototype = { if (page != $this.currentPage) { $($this).trigger('changePage', [page]); } - if(this.landingpage!==undefined) { + if (this.landingpage !== undefined) { this.landingpage.hide(); } this.menu.closeView(function () { @@ -354,7 +359,7 @@ Fluidbook.prototype = { else if (args[1] == 'landing') { $this.hideSplash(); - if(this.landingpage!==undefined) { + if (this.landingpage !== undefined) { this.landingpage.show(); } } diff --git a/js/libs/fluidbook/fluidbook.links.js b/js/libs/fluidbook/fluidbook.links.js index 38d89205..a5f2d450 100644 --- a/js/libs/fluidbook/fluidbook.links.js +++ b/js/libs/fluidbook/fluidbook.links.js @@ -11,6 +11,11 @@ FluidbookLinks.prototype = { this.lowdef = this.fluidbook.support.android || this.fluidbook.support.iOS; + $(document).on('click', '[href^="#"]:not([href="#"])', function () { + location.hash = $(this).attr('href'); + return false; + }); + $(document).on('click', '[data-wescosales-ref]', function () { }); @@ -103,6 +108,8 @@ FluidbookLinks.prototype = { return false; }); + + }, initLinks: function (pageNr) { if (pageNr == undefined) { -- 2.39.5