]> _ Git - fluidbook-html5.git/commitdiff
wip #3450 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 2 Mar 2020 11:19:47 +0000 (12:19 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 2 Mar 2020 11:19:47 +0000 (12:19 +0100)
js/libs/fluidbook/fluidbook.tabs.js

index b9aa169ce4f80bda732cd7b6e71dc5fddc09532e..ff346aea8c70a34e4ab88534b20b99e56efab2e1 100644 (file)
@@ -99,6 +99,9 @@ FluidbookTabs.prototype = {
 
     addLinks: function (pages) {
         pages = pages.map(function (x) {
+            if (x === '-') {
+                return '-';
+            }
             return parseInt(x);
         });
 
@@ -125,15 +128,18 @@ FluidbookTabs.prototype = {
             var nbPages = sectionPages.length;
             var i = 0;
             $.each(sectionPages, function (k, value) {
-                if (value % 2 === 1) {
-                    value--;
+                if (value !== '-') {
+                    console.log(value);
+                    if (value % 2 === 1) {
+                        value--;
+                    }
+                    $this.links.push({
+                        css: {height: (100 / nbPages) + '%', top: (100 / nbPages * i) + '%'},
+                        page: parseInt(value),
+                        index: index,
+                        id: 'o' + index
+                    });
                 }
-                $this.links.push({
-                    css: {height: (100 / nbPages) + '%', top: (100 / nbPages * i) + '%'},
-                    page: parseInt(value),
-                    index: index,
-                    id: 'o' + index
-                });
                 i++;
                 index++;
             });
@@ -245,7 +251,6 @@ FluidbookTabs.prototype = {
         var commoncss = {};
         commoncss.width = (100 * (this.linkWidth / this.naturalDimensions.width)) + "%";
         commoncss.left = (-100 * (this.margin / this.naturalDimensions.width)) + "%";
-        console.log(commoncss);
 
         $(this.links).each(function (k, v) {
             var l = $('<a class="tablink" />');