]> _ Git - fluidbook-html5.git/commitdiff
wait #5219 @1.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 7 Apr 2022 14:42:49 +0000 (16:42 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 7 Apr 2022 14:42:49 +0000 (16:42 +0200)
js/libs/fluidbook/fluidbook.input.js
js/libs/fluidbook/fluidbook.links.js
js/libs/fluidbook/fluidbook.menu.js

index f8381b667564dbc1a5596ebedd9f68086604dd0c..08b0c9fe55406ce61ee5419196e72c1aa6b4017c 100644 (file)
@@ -42,7 +42,7 @@ FluidbookInput.prototype = {
             this.setMouseClasses();
         }
 
-        if (Modernizr.ios || Modernizr.android) {
+        if (Modernizr.ios || Modernizr.android || this.fluidbook.settings.phonegap === 'ios' || this.fluidbook.settings.phonegap === 'android') {
             this.usingTouch = this.hasTouch = this.forceTouch = true;
             this.usingMouse = this.hasMouse = this.forceMouse = false;
             this.usingKeyboard = this.hasKeyboard = this.forceKeyboard = false;
@@ -68,8 +68,7 @@ FluidbookInput.prototype = {
 
     isUsingMouse: function () {
         return this.usingMouse;
-    },
-    isUsingKeyboard: function () {
+    }, isUsingKeyboard: function () {
         return this.usingKeyboard;
     },
 
@@ -79,15 +78,13 @@ FluidbookInput.prototype = {
             this.usingKeyboard = this.usingMouse = false;
             this.setTouchClasses();
         }
-    },
-    useMouse: function () {
+    }, useMouse: function () {
         if (!this.usingMouse) {
             this.hasMouse = this.usingMouse = true;
             this.usingKeyboard = this.usingTouch = false;
             this.setMouseClasses();
         }
-    },
-    useKeyboard: function () {
+    }, useKeyboard: function () {
         if (!this.usingKeyboard) {
             this.hasKeyboard = this.usingKeyboard = true;
             this.usingMouse = this.usingTouch = false;
@@ -103,16 +100,14 @@ FluidbookInput.prototype = {
             .addClass('using-touch')
             .addClass('no-using-keyboard');
 
-    },
-    setMouseClasses: function () {
+    }, setMouseClasses: function () {
         $('html').addClass('using-mouse')
             .addClass('no-using-touch')
             .addClass('no-using-keyboard')
             .removeClass('no-using-mouse')
             .removeClass('using-touch')
             .removeClass('using-keyboard');
-    },
-    setKeyboardClasses: function () {
+    }, setKeyboardClasses: function () {
         $('html').addClass('using-keyboard')
             .addClass('no-using-touch')
             .addClass('no-using-mouse')
index 17c6b48363003a698a754b0810dc9fb940f17f7a..45ad51be21815afb6e0fc59c191976fa562f8b0a 100644 (file)
@@ -32,22 +32,33 @@ FluidbookLinks.prototype = {
 
         if (this.fluidbook.settings.phonegap === 'ios') {
             $(document).on('touchstart touchend click', 'a.clickonly', function (e) {
-                e.preventDefault();
-                e.stopPropagation();
-                e.stopImmediatePropagation();
+                var cancel = function (e) {
+                    e.preventDefault();
+                    e.stopPropagation();
+                    e.stopImmediatePropagation();
+                };
 
                 if (e.type === 'touchstart') {
                     $(this).data('touchstart', Date.now());
+                    cancel(e);
                 } else if (e.type === 'touchend') {
                     var start = $(this).data('touchstart');
                     if (start === null) {
-                        return;
+                        cancel(e);
+                        return false;
                     }
                     var diff = Date.now() - start;
                     if (diff > 300) {
-                        return;
+                        cancel(e);
+                        return false;
+                    }
+                    var href = $(this).attr('href');
+                    if (href !== undefined && href !== null && href !== '' && href !== '#') {
+                        cancel(e);
+                        window.location = href;
+                        return false;
                     }
-                    window.location = $(this).attr('href');
+                    return true;
                 }
             });
         }
index ca0b0d7e1135dede664a9f52c81c6dcf64e112b6..f0b3f405137c11e2ba6455d48ca8e0bbf4896a66 100644 (file)
@@ -32,7 +32,9 @@ FluidbookMenu.prototype = {
 
     viewMode: function () {
         return $("#view .mview").length > 0;
-    }, openView: function (view, param1, param2, callback) {
+    },
+
+    openView: function (view, param1, param2, callback) {
         var $this = this;
 
         setTimeout(function () {
@@ -57,7 +59,9 @@ FluidbookMenu.prototype = {
         } else {
             this.__openView(view, param1, param2, callback);
         }
-    }, __openView: function (view, param1, param2, callback) {
+    },
+
+    __openView: function (view, param1, param2, callback) {
 
         try {
             if (typeof param1 === 'string') {
@@ -116,11 +120,15 @@ FluidbookMenu.prototype = {
         } else {
             this['open' + camelView](param1, param2, cb);
         }
+
+        this.fluidbook.nav.closeMenu();
     }, openNotes: function (p1, p2, cb) {
         this.fluidbook.notes.openMenu(cb);
     }, openSearch: function (q, cb) {
         this.fluidbook.nav.openSearch(q, cb);
-    }, openingView: function (callback, view) {
+    },
+
+    openingView: function (callback, view) {
         var $this = this;
         this.fluidbook.resize.resizeView();
         this.fluidbook.tooltip.hideTooltip();