]> _ Git - fluidbook-html5.git/commitdiff
wip #2116
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 5 Jul 2018 16:30:27 +0000 (18:30 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 5 Jul 2018 16:30:27 +0000 (18:30 +0200)
_index.html
js/libs/fluidbook/fluidbook.js
js/libs/fluidbook/fluidbook.links.js

index db6e7c291d42a0a7c803f6ab898303d9416e80b2..d7b8a9a984f4dcba79fcafea84f7715cc4aca152 100644 (file)
@@ -4,6 +4,7 @@
 <!--[if gt IE 9]><!-->
 <html prefix="og: http://ogp.me/ns#"><!--<![endif]-->
 <head>
+    <!-- $base -->
     <title><!-- $titre --></title>
     <meta charset="utf-8">
     <meta http-equiv="X-UA-Compatible" content="IE=Edge">
index 5359ecccbc06cca799636a0ed7e734c3830088b5..55c9e1d40fc86d1c4a8788a5a55a4b8bc68787dc 100644 (file)
@@ -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();
             }
         }
index 38d89205f86e9a85ad3949cb8cc1852764c9c578..a5f2d4505041f078c53e3cf44c929d1b7b453001 100644 (file)
@@ -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) {