]> _ Git - fluidbook-html5.git/commitdiff
fix #3247 @0.75
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 18 Dec 2019 17:41:40 +0000 (18:41 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 18 Dec 2019 17:41:40 +0000 (18:41 +0100)
js/libs/fluidbook/fluidbook.nav.js
js/libs/fluidbook/fluidbook.search.js

index 35b2335e03a89ccfa0ffd16df7c00b11a18fc4ff..8b4d46a2d318fa1ac142cb7474136147602cebcc 100644 (file)
@@ -419,7 +419,7 @@ FluidbookNav.prototype = {
                         }
                     } else if (navType === 'menu') {
                         // Save HTML so it can be added to menu once MMenu is initialised
-                        this.shareLinksHTML = '<div id="shareLinks"><div class="share-icons">' + this.fluidbook.share.getShareLinks(true,undefined,'publication') + '</div></div>';
+                        this.shareLinksHTML = '<div id="shareLinks"><div class="share-icons">' + this.fluidbook.share.getShareLinks(true, undefined, 'publication') + '</div></div>';
                     }
                 }
 
@@ -777,8 +777,10 @@ FluidbookNav.prototype = {
         if (q !== undefined) {
             $("#q").val(q);
             this.fluidbook.search.submitForm();
+        } else {
+            $('#q').focus(); // Put cursor in the search field
         }
-        $('#q').focus(); // Put cursor in the search field
+
         if (cb !== undefined) {
             cb();
         }
index 51eff1f1a8d8ba63af513ff8cf7399da28457d9d..e93a4c7a1d4584cafc81a41ae50e98e00744fe35 100644 (file)
@@ -829,9 +829,6 @@ FluidbookSearch.prototype = {
     },
     closeKeyboardonTouchDevices: function () {
         if (this.fluidbook.support.iOS || this.fluidbook.support.android) {
-            if (!$("#q").is(':focus')) {
-                return;
-            }
             $("#q").blur();
         }
     }