]> _ Git - fluidbook-html5.git/commitdiff
fix #1644 @1.5
authorVincent <vincent@cubedesigners.com>
Tue, 5 Sep 2017 14:01:12 +0000 (16:01 +0200)
committerVincent <vincent@cubedesigners.com>
Tue, 5 Sep 2017 14:01:12 +0000 (16:01 +0200)
js/libs/fluidbook/fluidbook.desktop.js
js/libs/fluidbook/fluidbook.menu.js
js/libs/fluidbook/fluidbook.support.js
js/libs/fluidbook/fluidbook.utils.js
js/main.js

index 7778a0e59c3b5b9dc1c4ca2d0c25b661ebd8377a..232a772e46cf4ff9f9a5841781875d344dd4521a 100644 (file)
@@ -30,10 +30,14 @@ FluidbookDesktop.prototype = {
         });
     },
     moveZoom: function (e, force) {
-        var x = e.pageX / this.fluidbook.resize.ww;
-        var y = e.pageY / this.fluidbook.resize.hh;
+        try {
+            var x = e.pageX / this.fluidbook.resize.ww;
+            var y = e.pageY / this.fluidbook.resize.hh;
 
-        this.fluidbook.zoom.setOriginPct(x, y, force)
+            this.fluidbook.zoom.setOriginPct(x, y, force);
+        }catch(err){
+
+        }
     },
     clickZoom: function (e, way) {
         if (way == undefined) {
index 0c981ac428ace59b19eb81c0c3a8814ab7869067..0148bfbe6d5338b7252558cfb4db04b1efbd0103 100644 (file)
@@ -611,6 +611,13 @@ FluidbookMenu.prototype = {
             m.find('.content').perfectScrollbar('update');
         }
 
+        $("#popinOverlay>div").each(function () {
+            $(this).css({
+                top: (hh - $(this).outerHeight()) / 2,
+                left: (ww - $(this).outerWidth()) / 2
+            });
+        });
+
         if ($("#archivesview").length == 1) {
             var w = this.fluidbook.datas.filesInfos.archives.width;
             var ratio = $("#archivesview img").width() / w;
index 9be43a4be9b7b7fb9380892376a696f6713bc464..45f17fb42df08545908f0fb16c78a8dbf9d4e40b 100644 (file)
@@ -98,12 +98,11 @@ FluidbookSupport.prototype = {
 
         var $this = this;
 
-        if (!this.isMobile) {
+        if (!isMobile(false)) {
             $(window).resize(function () {
                 resize();
             });
         } else {
-
             if ("onorientationchange" in window) {
                 window.addEventListener('orientationchange', function () {
                     resize();
index d7d220b8c40377c4c473dedc8c2f688286a6bce3..ef8bb8c84b7e23ac4e1f13efe5581751ef9f84f4 100644 (file)
@@ -1,9 +1,12 @@
-function isMobile() {
+function isMobile(returnTrueIfTouch) {
+    if(returnTrueIfTouch==undefined){
+        returnTrueIfTouch=true;
+    }
     var ua = navigator.userAgent;
     var devices = ['iphone', 'ipad', 'ipod', 'droid', 'blackberry', 'mobile', 'htc', 'samsung', 'nokia', 'archos', 'galaxy', 'motorola', 'pad', 'tab', 'slate', 'motorola', 'symbian', 'phone', 'nintendo', 'playstation', 'touch', 'webos', 'ericsson'];
     var pattern;
 
-    if (Modernizr.ftouch) {
+    if (Modernizr.ftouch && returnTrueIfTouch) {
         return true;
     }
 
index 5c8334b8f4e81417a8daa7ba9684425035d82677..5b6c2e595bce01ef1c5435bbf078b34127864cf2 100644 (file)
@@ -1,6 +1,7 @@
 var DEVICE_READY_BEFORE_JQUERY = false;
 var JQUERY_READY = false;
 document.addEventListener('deviceready', _onDeviceReady, false);
+
 function _onDeviceReady() {
     if (JQUERY_READY) {
         onDeviceReady();
@@ -438,16 +439,6 @@ function resize(init) {
         init = false;
     }
     fluidbook.resize.resize(init);
-
-    var ww = $(window).width();
-    var wh = $(window).height();
-    $("#popinOverlay>div").each(function () {
-        $(this).css({
-            top: (wh - $(this).outerHeight()) / 2,
-            left: (ww - $(this).outerWidth()) / 2
-        });
-    });
-
 }
 
 function goNextPage(e) {