]> _ Git - fluidbook-html5.git/commitdiff
wip #2299 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 23 Oct 2018 16:59:19 +0000 (18:59 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 23 Oct 2018 16:59:19 +0000 (18:59 +0200)
js/libs/fluidbook/menu/fluidbook.index.js
style/fluidbook.less

index b2b6f7ac7d70475bb9ac240f8981a796ca71b06b..a2e92d7aa0301d3c65f447ce4b52c780b1df6e50 100644 (file)
@@ -7,6 +7,7 @@ FluidbookIndex.prototype = {
     init: function () {
         this.normalHTML = '';
         this.padHTML = '';
+        this.singleMode = this.fluidbook.datas.mobileNavigationType === 'portrait';
     },
 
     getView: function (group) {
@@ -29,19 +30,28 @@ FluidbookIndex.prototype = {
             var c = '';
             var s1, s2;
 
-            for (var i = 0; i <= this.fluidbook.getMaxPage(); i += 2) {
+            var increment = this.singleMode ? 1 : 2;
+            var start = this.singleMode ? 1 : 0;
+
+            for (var i = start; i <= this.fluidbook.getMaxPage(); i += increment) {
                 var pages = [];
                 j = i + 1;
                 ix1 = '';
                 ix2 = '';
-                c = '';
 
-                if (this.fluidbook.l10n.dir == 'ltr') {
-                    s1 = 'left';
-                    s2 = 'right'
+                if (this.singleMode) {
+                    c = ' singlemode simple left ';
+                    s2 = s1 = 'left';
                 } else {
-                    s1 = 'right';
-                    s2 = 'left'
+                    c = '';
+
+                    if (this.fluidbook.l10n.dir == 'ltr') {
+                        s1 = 'left';
+                        s2 = 'right'
+                    } else {
+                        s1 = 'right';
+                        s2 = 'left'
+                    }
                 }
 
                 if (i > 0) {
@@ -51,7 +61,6 @@ FluidbookIndex.prototype = {
                     }
                     pages.push(i);
                     ix1 += '</div>';
-
                 } else {
                     c = ' simple ' + s2;
                 }
@@ -64,22 +73,26 @@ FluidbookIndex.prototype = {
                     s2 = 'left'
                 }
 
-                if (j <= this.fluidbook.getMaxPage()) {
-                    ix2 += '<div class="thumb ' + s1 + '"><a href="#/page/' + j + '">' + this.fluidbook.loader.getThumbImage(j, null, true) + '</a><span class="number">' + this.fluidbook.physicalToVirtual(j) + '</span>';
-                    if (this.fluidbook.bookmarks.enabled) {
-                        ix2 += this.fluidbook.bookmarks.getBookmarkForPage(j, true);
+                if (!this.singleMode) {
+                    if (j <= this.fluidbook.getMaxPage()) {
+                        ix2 += '<div class="thumb ' + s1 + '"><a href="#/page/' + j + '">' + this.fluidbook.loader.getThumbImage(j, null, true) + '</a><span class="number">' + this.fluidbook.physicalToVirtual(j) + '</span>';
+                        if (this.fluidbook.bookmarks.enabled) {
+                            ix2 += this.fluidbook.bookmarks.getBookmarkForPage(j, true);
+                        }
+                        ix2 += '</div>';
+                        pages.push(j);
+                    } else {
+                        c = ' simple ' + s2;
                     }
-                    ix2 += '</div>';
-                    pages.push(j);
-                } else {
-                    c = ' simple ' + s2;
-                }
 
-                if (j == 1) {
-                    pages.unshift(0);
-                }
+                    if (j == 1) {
+                        pages.unshift(0);
+                    }
 
-                ix = ix1 + ix2;
+                    ix = ix1 + ix2;
+                } else {
+                    ix = ix1;
+                }
                 this.normalHTML += '<div class="doubleThumb' + c + '" page="' + i + '" data-pages="' + pages.join(',') + '">' + ix;
                 this.normalHTML += '</div>';
             }
index 384702364f49d46ef84af60675902afc1a29a3c3..d90583e1b0cd14756f2a24170ed068b4ca29d5ce 100644 (file)
@@ -1603,6 +1603,10 @@ form input[type="text"], form input[type="email"] {
                text-align: center;
                box-sizing: content-box;
                border-radius: 3px;
+
+               &.singlemode {
+                       width: 100px;
+               }
        }
 
        &.bookmarkView {
@@ -2903,7 +2907,7 @@ body > input {
        0% {
                margin-top: 0px;
        }
-       100%{
+       100% {
                margin-top: -40px;
        }
 }