]> _ Git - fluidbook-html5.git/commitdiff
wait #5251 @1.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 22 Apr 2022 14:50:33 +0000 (16:50 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 22 Apr 2022 14:50:33 +0000 (16:50 +0200)
js/libs/fluidbook/fluidbook.help.js
js/libs/fluidbook/fluidbook.menu.js
js/libs/fluidbook/fluidbook.nav.js
js/libs/fluidbook/fluidbook.search.js

index 0566dde297a0aa153390f772c6a3c5755ed6bce3..420f3e8b19eea8b10e1d5936f8e8ff1b0c574f7e 100644 (file)
@@ -198,7 +198,7 @@ FluidbookHelp.prototype = {
         $(document).on(this.fluidbook.input.clickEvent, '.icon-help', function (e) {
             $this.show();
             if ($this.fluidbook.nav.menuIsOpen) {
-                $this.fluidbook.nav.menuAPI.close();
+                $this.fluidbook.nav.closeMenu();
             }
             e.preventDefault();
         });
index ba65882a3e8b04ba9119b5a91140642cbc597b6b..f26f34e66617ba9aa378ab2831ecbe78bb0157e3 100644 (file)
@@ -63,6 +63,7 @@ FluidbookMenu.prototype = {
 
     __openView: function (view, param1, param2, callback) {
 
+        var closeMenu = true;
         try {
             if (typeof param1 === 'string') {
                 param1 = decodeURIComponent(param1);
@@ -110,6 +111,7 @@ FluidbookMenu.prototype = {
         } else if (view === 'freeiframe') {
             this.openFreeiframe(param1, cb);
         } else if (view === 'search') {
+            closeMenu = false;
             this.openSearch(param1, cb);
         } else if (view === 'print') {
             this.openPrint(cb);
@@ -121,7 +123,9 @@ FluidbookMenu.prototype = {
             this['open' + camelView](param1, param2, cb);
         }
 
-        this.fluidbook.nav.closeMenu();
+        if (closeMenu) {
+            this.fluidbook.nav.closeMenu();
+        }
     }, openNotes: function (p1, p2, cb) {
         this.fluidbook.notes.openMenu(cb);
     }, openSearch: function (q, cb) {
index 4203ab68ffe51bbfb284d623e24e17394a64a3bc..1b1d18434474a02586486ca01f9d659d81f8562e 100644 (file)
@@ -91,7 +91,7 @@ FluidbookNav.prototype = {
 
         // Close menu when a search result is clicked
         $(document).on(this.fluidbook.input.clickEvent, '#menuSearchResults a', function (e) {
-            $this.menuAPI.close();
+            $this.closeMenu();
         });
 
         // Recalculate available size for menu search results
@@ -113,7 +113,7 @@ FluidbookNav.prototype = {
                 return false;
             }
 
-            $this.menuAPI.close();
+            $this.closeMenu();
         });
 
 
@@ -124,7 +124,8 @@ FluidbookNav.prototype = {
         $('#menuList > ul, #chapterList').perfectScrollbar({
             suppressScrollX: true, minScrollbarLength: 40, //maxScrollbarLength: 60
         });
-    }, closeMenu: function () {
+    },
+    closeMenu: function () {
         this.menuAPI.close();
     }, // getIcon: function (name) {
     //     var src = 'data/images/' + name + '.';
@@ -376,7 +377,7 @@ FluidbookNav.prototype = {
                             window.location = $($thislink).attr('href');
                         }, 500);
                     } else {
-                        $this.menuAPI.close();
+                        $this.closeMenu();
                         window.location = $(this).attr('href');
                     }
                     return false;
@@ -743,7 +744,7 @@ FluidbookNav.prototype = {
 
         // Full screen toggle
         $(document).on(this.fluidbook.input.clickEvent, '.icon-fullscreen', function () {
-            $this.menuAPI.close();
+            $this.closeMenu();
             screenfull.toggle();
             return false;
         });
@@ -777,12 +778,13 @@ FluidbookNav.prototype = {
                 this.menuAPI.closeAllPanels(); // Make sure we're on the main panel with the search box
             }
         }
-        this.menuAPI.open();
+
 
         if (q !== undefined) {
             $("#q").val(q);
             this.fluidbook.search.submitForm();
         } else {
+            this.menuAPI.open();
             $('#q').focus(); // Put cursor in the search field
         }
 
@@ -803,7 +805,7 @@ FluidbookNav.prototype = {
             if ($this.fluidbook.search.isSearchActive()) {
                 $this.fluidbook.search.closeSearch();
                 if ($("#horizontalNav").is(':visible')) {
-                    $this.menuAPI.close();
+                    $this.closeMenu();
                 }
             } else {
                 // If we're closing the menu but the search was open and nothing
@@ -816,7 +818,7 @@ FluidbookNav.prototype = {
                     $this.fluidbook.search.closeSearch();
                 }
 
-                $this.menuAPI.close();
+                $this.closeMenu();
             }
         });
 
index 6270325654ec44023a0fae254a27796e846229a5..6313808f408735edaa8020715945de5e3934ef60 100644 (file)
@@ -824,7 +824,7 @@ FluidbookSearch.prototype = {
         if (gotoPageIfOneResult && spreadEnabled === 1) {
             setTimeout(function () {
                 fluidbook.setCurrentPage($this.menuSearchResults.find('.doubleThumb[data-enabled="1"]').attr('page'));
-                fluidbook.nav.menuAPI.close();
+                fluidbook.nav.closeMenu();
             }, 100);
             return;
         }