]> _ Git - fluidbook-html5.git/commitdiff
wait #7220 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 5 Dec 2024 15:47:02 +0000 (16:47 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 5 Dec 2024 15:47:02 +0000 (16:47 +0100)
js/libs/fluidbook/fluidbook.menu.js

index 2ba85a85bc59cab34bbc1e93da99971c3798e73f..4065ee98f3a1b939971c882198d0e6e08078f817 100644 (file)
@@ -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 += '<div class="content"><div class="pdf-holder"><iframe class="pdf view ' + infos.interface + '" data-width="' + infos.width + '" data-height="' + infos.height + '" data-total-height="' + infos.totalHeight + '" frameborder="0" scrolling="no" src="pdfjs/web/viewer.html?&file=../../data/links/' + infos.file + '#zoom=page-width"></iframe></div></div>';