From: Vincent Vanwaelscappel Date: Wed, 4 Sep 2019 13:48:39 +0000 (+0200) Subject: wip #3000 @0:20 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=a68732636619e163c605cc1e31cf9f10b91fe35e;p=fluidbook-html5.git wip #3000 @0:20 --- diff --git a/js/libs/fluidbook/fluidbook.interface.js b/js/libs/fluidbook/fluidbook.interface.js index 736826f3..d0435ac8 100644 --- a/js/libs/fluidbook/fluidbook.interface.js +++ b/js/libs/fluidbook/fluidbook.interface.js @@ -53,7 +53,7 @@ FluidbookInterface.prototype = { }, autoHideArrows: function () { - var res = this.arrowsEnabled && this.fluidbook.resize.reduceHorizontalMargins() && this.areArrowsOverlapingPublication() && ($("#helpView:visible").length === 0); + var res = this.arrowsEnabled && (this.fluidbook.resize===undefined || this.fluidbook.resize.reduceHorizontalMargins()) && this.areArrowsOverlapingPublication() && ($("#helpView:visible").length === 0); return res; }, @@ -76,10 +76,8 @@ FluidbookInterface.prototype = { $(document).on('click', ':not(a)', function () { var selector = '#fluidbook'; if (!$(this).is(selector) && $(this).closest(selector).length === 0) { - console.log('nok', $(this)); return true; } - console.log('ok', $(this)); $this.toggleInterface(1000); return true; }); diff --git a/js/libs/fluidbook/fluidbook.js b/js/libs/fluidbook/fluidbook.js index 696df85b..1fabdfe3 100644 --- a/js/libs/fluidbook/fluidbook.js +++ b/js/libs/fluidbook/fluidbook.js @@ -101,6 +101,7 @@ Fluidbook.prototype = { this.contentlock.init(); + this.nav = new FluidbookNav(this); this.interface = new FluidbookInterface(this); this.resize = new FluidbookResize(this); this.pagetransitions = new FluidbookPageTransition(this); @@ -266,7 +267,6 @@ Fluidbook.prototype = { $("#main").css('display', 'block'); - this.nav = new FluidbookNav(this); if (!this.mobilefirst.enabled) { this.slider = new FluidbookSlider(this); } diff --git a/js/libs/fluidbook/fluidbook.nav.js b/js/libs/fluidbook/fluidbook.nav.js index f0b1b80b..38f2c2e9 100644 --- a/js/libs/fluidbook/fluidbook.nav.js +++ b/js/libs/fluidbook/fluidbook.nav.js @@ -69,7 +69,9 @@ FluidbookNav.prototype = { $('body').addClass('menu-open'); $this.menuIsOpen = true; - setInterval($this.fluidbook.resize.resizeMenu, 500); + setInterval(function () { + $this.fluidbook.resize.resizeMenu() + }, 500); //$('#q').focus(); // Disabled for now because it triggers the keyboard to open on some mobile devices }); @@ -91,7 +93,9 @@ FluidbookNav.prototype = { }); // Recalculate available size for menu search results - $(this.fluidbook).on('fluidbook.resize', this.fluidbook.resize.resizeMenu); + $(this.fluidbook).on('fluidbook.resize', function () { + $this.fluidbook.resize.resizeMenu(); + }); // Handle swipe to close (it's only really practical to have this because swipe to open would interfere with main Fluidbook swipes) // We are not using MMenu's "Drag" add-on because it doesn't close the main menu, only submenus on swipe. @@ -595,10 +599,10 @@ FluidbookNav.prototype = { } } - if (navType == 'menu') { + if (navType === 'menu') { // Insert Chapters submenus - if (this.chaptersMenuHTML != '') { + if (this.chaptersMenuHTML !=='') { $('#menu_chapters').parent().append(this.chaptersMenuHTML); }