]> _ Git - fluidbook-html5.git/commitdiff
fix #1374 @1.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 2 May 2017 12:05:11 +0000 (14:05 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 2 May 2017 12:05:11 +0000 (14:05 +0200)
js/libs/fluidbook/fluidbook.nav.js
js/libs/fluidbook/fluidbook.resize.js
js/libs/fluidbook/fluidbook.touch.js
js/main.js

index 673c3707eb57ac0873472d1dfa15aa36e76e1d5b..69e0972b55d10945386db44f58aac7839e24b98d 100644 (file)
@@ -251,7 +251,7 @@ FluidbookNav.prototype = {
         var res = this.getLink('interface-previous', '#', 'previous', '', '', false);
         res += this.getLink('interface-next', '#', 'next', '', '', false);
         $('#interface').append(res);
-        $(document).on('click touchend', '#next', goNextPage);
-        $(document).on('click touchend', '#previous', goPreviousPage);
+        $(document).on('touchstart click', '#next', goNextPage);
+        $(document).on('touchstart click', '#previous', goPreviousPage);
     }
 };
\ No newline at end of file
index f7b1ee9729b831f544ed54aa8f337b2c9fb8ec2f..b77de0b55b6ef93d096c5bfed100809a1e54ed33 100644 (file)
@@ -118,24 +118,9 @@ FluidbookResize.prototype = {
         if (this.orientation == 'landscape') {
             fww *= 2;
         }
-        // console.log('aw : ' + aw);
-        // console.log('fww : ' + fww);
-        // console.log('ah : ' + ah);
-        // console.log('fhh : ' + fhh);
-        // console.log('interfaceScale : ' + interfaceScale);
-        // console.log('extraX : ' + extraX);
-        // console.log('margintop : ' + this.margintop);
-        // console.log('marginbottom : ' + this.marginbottom);
-        // console.log('marginleft : ' + this.marginleft);
-        // console.log('marginright : ' + this.marginright);
-        console.log('marginLeft : ' + marginLeft);
-        console.log('marginTop : ' + marginTop);
-        console.log('marginBottom : ' + marginBottom);
-        console.log('marginRight : ' + marginRight);
-
 
         this.bookScale = Math.min(aw / fww, ah / fhh);
-        console.log('bookScale : ' + this.bookScale);
+
         var fw = this.bookScale * fww;
         var fh = this.bookScale * fhh;
         $("#fluidbook").transform({
index a18959b1be645763234cf487a0f079c00ed9880c..b54d1f9148e52cd52d80e17ef3154e5b971c248d 100644 (file)
@@ -71,7 +71,6 @@ FluidbookTouch.prototype = {
     },
 
     dragzoom: function (e) {
-        console.log(e.dx + ' :: ' + e.dy);
         if (e.dx == 0 && e.dy == 0) {
             return;
         }
index a8beb3cb7334ee07fa92818afa3293ab6911f9da..0f3f250d76a282cbc1860a59792bb40bf8b9c2fd 100644 (file)
@@ -491,12 +491,15 @@ function goNextPage(e) {
     if (fluidbook.help.isVisible()) {
         return;
     }
-    try {
+
+    if (e.originalEvent.touches != undefined && e.originalEvent.touches.length > 0) {
+        var o = $("#next").offset();
         y = e.originalEvent.touches[0].pageY - o.top;
-    } catch (err) {
+    } else {
         y = e.offsetY == undefined ? e.originalEvent.layerY : e.offsetY;
     }
 
+
     if (y < 65) {
         if (fluidbook.pad.enabled) {
             fluidbook.goNextChapter();
@@ -514,9 +517,11 @@ function goPreviousPage(e) {
         return;
     }
     var y;
-    try {
+
+    if (e.originalEvent.touches != undefined && e.originalEvent.touches.length > 0) {
+        var o = $("#previous").offset();
         y = e.originalEvent.touches[0].pageY - o.top;
-    } catch (err) {
+    } else {
         y = e.offsetY == undefined ? e.originalEvent.layerY : e.offsetY;
     }
     if (y < 65) {