]> _ Git - fluidbook-html5.git/commitdiff
wip #2707 @2.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 9 May 2019 17:47:18 +0000 (19:47 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 9 May 2019 17:47:18 +0000 (19:47 +0200)
js/libs/fluidbook/fluidbook.menu.js
js/libs/fluidbook/fluidbook.mobilefirst.js
js/libs/fluidbook/fluidbook.touch.js
style/mobilefirst.less

index 276afd9085d016395e8834ea18d3ee518cdee1cd..c539267185012114b3052c87a7581ae3782a7e65 100644 (file)
@@ -452,7 +452,7 @@ FluidbookMenu.prototype = {
         this.fluidbook.stats.track(14);
     },
     openIndex: function (title, group, closeAll, callback) {
-        this.index.openIndex(title,group,closeAll,callback);
+        this.index.openIndex(title, group, closeAll, callback);
     },
     openArchives: function (title, callback) {
         var archives = '<div class="caption">' + this.closeButton() + '<h2>' + title + '</h2></div>';
@@ -596,7 +596,11 @@ FluidbookMenu.prototype = {
                 break;
             case 'index':
                 fullscreen = true;
-                $("#indexViewHolder").css('width', Math.floor(ww / 230) * 230);
+                if (this.fluidbook.mobilefirst.enabled) {
+                    this.fluidbook.mobilefirst.resizeIndex();
+                } else {
+                    $("#indexViewHolder").css('width', Math.floor(ww / 230) * 230);
+                }
                 break;
             case 'share':
                 w = 200;
index c03ff14343f8c17a0bcb4f5b7d48a95d4b8d51b5..838b85e04f69845c7ac2a94ca1bb7658c4aff659 100644 (file)
@@ -107,4 +107,12 @@ FluidbookMobileFirst.prototype = {
 
         return footer;
     },
+
+    resizeIndex: function () {
+        $("#indexViewHolder").css('width', this.fluidbook.datas.pages * 130);
+        setTimeout(function () {
+            $("#indexView").perfectScrollbar('update');
+        }, 500)
+        $("#indexView").perfectScrollbar();
+    },
 }
\ No newline at end of file
index b5c993f0cad02409951ba2909c5d57f722262e68..c7b17bff540d508dfbc69d6b46bd1af39df0c1f8 100644 (file)
@@ -69,7 +69,7 @@ FluidbookTouch.prototype = {
 
         hm.on('pinchstart', function (event) {
             console.log('pinchstart');
-            if ($this.fluidbook.zoom.zoom == 1) {
+            if ($this.fluidbook.zoom.zoom === 1) {
                 $this.setZoomOriginFromEvent({'pageX': event.center.x, 'pageY': event.center.y});
             }
             $this.zoomAtPinchStart = $this.fluidbook.zoom.zoom;
@@ -79,7 +79,7 @@ FluidbookTouch.prototype = {
 
         hm.on('pinch', function (event) {
             console.log('pinch');
-            if ($this.zoomAtPinchStart != 0) {
+            if ($this.zoomAtPinchStart !== 0) {
                 $this.pinchZoom(event.scale, false);
                 event.preventDefault();
             }
@@ -94,14 +94,12 @@ FluidbookTouch.prototype = {
         var hmf = new Hammer.Manager(document.getElementById('fluidbook'), options);
         hmf.add(new Hammer.Pan({threshold: 0}));
         hmf.on('panmove', function (event) {
-            console.log('panmove');
             if ($this.drag(event)) {
                 console.log('prevent scroll')
                 event.preventDefault();
             }
         });
         hmf.on('panend', function (event) {
-            console.log('panend');
             var prevent = $this.drag(event, true);
             $this.startX = $this.startY = -1;
             $this.panX = $this.panY = 0;
@@ -112,7 +110,7 @@ FluidbookTouch.prototype = {
     },
 
     pinchZoom: function (s, end) {
-        if (s == 1) {
+        if (s === 1) {
             return;
         }
 
@@ -133,10 +131,13 @@ FluidbookTouch.prototype = {
 
 
     drag: function (e, end) {
-        if (end == undefined) {
+        if (end === undefined) {
             end = false;
         }
         if (this.fluidbook.zoom.zoom === 1) {
+            if (this.fluidbook.mobilefirst.enabled) {
+                return false;
+            }
             if (this.startX === -1) {
                 this.startX = e.center.x;
             }
@@ -167,7 +168,7 @@ FluidbookTouch.prototype = {
         this.panX = e.deltaX;
         this.panY = e.deltaY;
 
-        if (e.dx == 0 && e.dy == 0) {
+        if (e.dx === 0 && e.dy === 0) {
             return;
         }
 
index e2bdfdf6ff0b17000f0edf05c8a814cc8885948d..b7bb511fd1dba0575c15422ecc7864abbe8294f6 100644 (file)
       }
     }
   }
+
+  #indexView {
+    min-width: 100%;
+    height: 100%;
+    overflow-x: auto;
+    padding: 25px;
+
+    #indexViewHolder {
+      margin-top: 5px;
+    }
+  }
 }