From: Vincent Vanwaelscappel Date: Thu, 5 Dec 2024 15:47:02 +0000 (+0100) Subject: wait #7220 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=8b9d1743a6de71edf33140ea70251b9cc2aa1c4f;p=fluidbook-html5.git wait #7220 @0.5 --- diff --git a/js/libs/fluidbook/fluidbook.menu.js b/js/libs/fluidbook/fluidbook.menu.js index 2ba85a85..4065ee98 100644 --- a/js/libs/fluidbook/fluidbook.menu.js +++ b/js/libs/fluidbook/fluidbook.menu.js @@ -13,14 +13,26 @@ FluidbookMenu.prototype = { // Note: iOS won't catch click events unless the element has a cursor:pointer style // This was added for #viewOverlay in the CSS // More details: https://stackoverflow.com/a/16006333 - $(document).on(this.fluidbook.input.clickEvent, ".mview .button.back, #viewOverlay", function (e) { + $(document).on(this.fluidbook.input.clickEvent, ".mview .button.back", function (e) { + return handleCloseView(e, true); + }); + + $(document).on(this.fluidbook.input.clickEvent, "#viewOverlay", function (e) { + // Don't close if a interactive multimedia popup is currently displayed + let close = $(".mview[data-menu=multimedia] .multimediaScale .multimedia:not(.notinteractive)").length === 0; + return handleCloseView(e, close); + }); + + function handleCloseView(e, closeView) { e.stopImmediatePropagation(); e.stopPropagation(); e.preventDefault(); - $this.closeView(function () { - }, false); + if (closeView) { + $this.closeView(function () { + }, false); + } return false; - }); + } if (this.fluidbook.settings.displayChaptersAtStart) { $(this.fluidbook).on('fluidbook.splash.hide', function () { @@ -140,7 +152,7 @@ FluidbookMenu.prototype = { }, openPDF: function (uid, callback) { - let $this=this; + let $this = this; var infos = this.fluidbook.settings.pdfLinks[uid]; let c = this.getCaption('', 'nocaption', 'nocaption'); c += '
';