]> _ Git - fluidbook-html5.git/commitdiff
wait #2707 @2
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 10 May 2019 12:01:43 +0000 (14:01 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 10 May 2019 12:01:43 +0000 (14:01 +0200)
js/libs/fluidbook/fluidbook.loader.js
js/libs/fluidbook/fluidbook.mobilefirst.js
js/libs/fluidbook/menu/fluidbook.index.js
style/fluidbook.less
style/mobilefirst.less

index 2112688b7cdd40f37cb0185159de1bb85aa87de1..6526f36a0ce952a6ed28506b4da59441c0fee800 100644 (file)
@@ -23,9 +23,16 @@ FluidbookLoader.prototype = {
         this.shadeRight = this.loadImage('images/shadows/pages/right.png');
     },
 
-    getPageDimensions: function (page) {
+    getPageDimensions: function (page, width) {
         var dim = this.fluidbook.datas.pagesDimensions[page];
-        return {width: dim[0], height: dim[1]};
+        var height;
+        if (undefined === width) {
+            width = dim[0];
+            height = dim[1];
+        } else {
+            height = dim[1] * (width / dim[0]);
+        }
+        return {width: width, height: height};
     },
 
     getVersionToLoad: function (page) {
index 838b85e04f69845c7ac2a94ca1bb7658c4aff659..f112daa19927b0398c9dab4619d61fdd6bbdb9ea 100644 (file)
@@ -111,8 +111,13 @@ FluidbookMobileFirst.prototype = {
     resizeIndex: function () {
         $("#indexViewHolder").css('width', this.fluidbook.datas.pages * 130);
         setTimeout(function () {
-            $("#indexView").perfectScrollbar('update');
+            $("#indexViewHolder").perfectScrollbar('update');
+            $("#indexViewHolder").find('.ps__rail-x').addClass('ps--clicking');
         }, 500)
-        $("#indexView").perfectScrollbar();
+        $("#indexViewHolder").perfectScrollbar({
+            suppressScrollY: true,
+            useBothWheelAxes: true
+        });
+        $("#indexViewHolder").find('.ps__rail-x').addClass('ps--clicking');
     },
 }
\ No newline at end of file
index 91943f386e22920430c991a1993dfe58a0345bd5..30dd54c670de87598cffbfcb40b757ed600ca70d 100644 (file)
@@ -94,7 +94,14 @@ FluidbookIndex.prototype = {
                 }
 
                 if (i > 0) {
-                    ix1 += '<div class="thumb ' + s1 + '"><a href="#/page/' + i + '">' + this.fluidbook.loader.getThumbImage(i, true) + '</a><span class="number">' + this.fluidbook.physicalToVirtual(i) + '</span>';
+                    var h = '';
+                    var pnt = '';
+                    if (this.fluidbook.mobilefirst.enabled) {
+                        var ph = this.fluidbook.loader.getPageDimensions(i, 100).height;
+                        h = ' style="height:' + ph + 'px;"'
+                        pnt = ' style="top:' + (ph - 5) + 'px;"';
+                    }
+                    ix1 += '<div class="thumb ' + s1 + '"' + h + '><a href="#/page/' + i + '">' + this.fluidbook.loader.getThumbImage(i, true) + '</a><span class="number"' + pnt + '>' + this.fluidbook.physicalToVirtual(i) + '</span>';
                     if (this.fluidbook.bookmarks.enabled) {
                         ix1 += this.fluidbook.bookmarks.getBookmarkForPage(i, true);
                     }
@@ -112,7 +119,6 @@ FluidbookIndex.prototype = {
                     s2 = 'left'
                 }
                 if (!this.singleMode) {
-
                     if (j <= this.fluidbook.contentlock.getMaxPage()) {
                         ix2 += '<div class="thumb ' + s1 + '"><a href="#/page/' + j + '">' + this.fluidbook.loader.getThumbImage(j, true) + '</a><span class="number">' + this.fluidbook.physicalToVirtual(j) + '</span>';
                         if (this.fluidbook.bookmarks.enabled) {
@@ -132,7 +138,13 @@ FluidbookIndex.prototype = {
                 } else {
                     ix = ix1;
                 }
-                this.normalHTML += '<div class="doubleThumb' + c + '" page="' + i + '" data-pages="' + pages.join(',') + '">' + ix;
+
+                var dth = '';
+                if (this.fluidbook.mobilefirst.enabled) {
+                    dth = ' style="height:' + ph + 'px;"';
+                }
+
+                this.normalHTML += '<div class="doubleThumb' + c + '" page="' + i + '" data-pages="' + pages.join(',') + '"' + dth + '>' + ix;
                 this.normalHTML += '</div>';
             }
             this.normalHTML += '</div></div></div>';
index d5062af820e0e46ffd1a717001be2f7baffbd7f8..bbc6f776fd846553770e0fa6bff8b581b2069715 100644 (file)
@@ -1805,6 +1805,7 @@ form input[type="text"], form input[type="email"] {
     text-align: center;
     box-sizing: content-box;
     border-radius: 3px;
+    vertical-align: top;
 
     &.singlemode {
       width: 100px;
index 433bc37804fce4dd2f9e17aa2b1978e7e29bb54d..3e398b2704dc6662293c94be4aea2ea096ac2d60 100644 (file)
   #indexView {
     min-width: 100%;
     height: 100%;
-    overflow-x: auto;
-    padding: 25px;
+    overflow: hidden !important;
 
     #indexViewHolder {
+      min-width: 100%;
+      max-width: 100%;
+      overflow-x: auto;
+      overflow-y: hidden;
       margin-top: 5px;
+      position: relative;
+      height: 100%;
+      white-space: nowrap;
+      padding: 25px 20px;
+
+      .ps__rail-x {
+        margin:0 25px;
+        transform: translate(0, -25px) !important;
+        opacity: 1 !important;
+      }
     }
   }
+
+  .thumb {
+    &:before {
+      display: none;
+    }
+
+    box-shadow: 0 0 5px rgba(0, 0, 0, .3);
+  }
 }