]> _ Git - fluidbook-html5.git/commitdiff
wait #5057 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 26 Jan 2022 14:01:08 +0000 (15:01 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 26 Jan 2022 14:01:08 +0000 (15:01 +0100)
js/libs/fluidbook/fluidbook.nav.js

index 7c9d672e701976294844ace2dcaa61c216b6616f..0ac66d16406fa5e30df4944a552062117775c516 100644 (file)
@@ -469,9 +469,9 @@ FluidbookNav.prototype = {
             } else if (icon === 'basket' && this.fluidbook.cart !== undefined && this.fluidbook.cart.enabled) {
                 // __('basket')
                 link = this.addLink(navType, this.fluidbook.settings.cartIcon, '#/cart', 'cart', 'basket', 'basket', 'Control+Alt+C');
-                $(this.fluidbook).on('fluidbook.cart.updateIcon', {link:link},function (e, data) {
+                $(this.fluidbook).on('fluidbook.cart.updateIcon', {link: link}, function (e, data) {
                     var n = data.number;
-                    var l = $("#" +$(e.data.link).attr('id'));
+                    var l = $("#" + $(e.data.link).attr('id'));
 
                     if (n === 0) {
                         $(l).find('span.number').remove();
@@ -606,7 +606,7 @@ FluidbookNav.prototype = {
                 // Process link ID from editor
                 if (extraURL.indexOf('link:') === 0) {
                     var linkId = extraURL.split(':', 2)[1];
-                    var foundLink='';
+                    var foundLink = '';
                     $.each(this.fluidbook.settings.links, function (page, plinks) {
                         var allLinks = '';
                         $.each(plinks, function (blendmode, links) {
@@ -619,7 +619,7 @@ FluidbookNav.prototype = {
                         }
                     });
 
-                    if(foundLink===''){
+                    if (foundLink === '') {
                         console.log('link not found');
                         continue;
                     }
@@ -642,7 +642,6 @@ FluidbookNav.prototype = {
             }
 
 
-
             if (!visible) {
                 $(link).addClass('hidden');
                 if (link2) {
@@ -852,6 +851,10 @@ FluidbookNav.prototype = {
             // and return the user to the main menu instead of closing the menu
             if ($this.fluidbook.search.isSearchActive()) {
                 $this.fluidbook.search.closeSearch();
+                if (!$("#horizontalNav").is(':visible')) {
+                    $this.menuAPI.close();
+
+                }
             } else {
                 // If we're closing the menu but the search was open and nothing
                 // was searched for, we need to reset the menu...