From 4ced3a39ee81cadff641a19af39b87db3857ae54 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Tue, 6 Jan 2026 17:25:00 +0100 Subject: [PATCH] wip #7871 @1.5 --- js/libs/fluidbook/fluidbook.menu.js | 20 ++++++++++++++------ js/libs/fluidbook/menu/fluidbook.pdfform.js | 14 +++++++++++--- style/menu-pdf.less | 6 ++++++ 3 files changed, 31 insertions(+), 9 deletions(-) diff --git a/js/libs/fluidbook/fluidbook.menu.js b/js/libs/fluidbook/fluidbook.menu.js index 9f2d424e..15e25cd4 100644 --- a/js/libs/fluidbook/fluidbook.menu.js +++ b/js/libs/fluidbook/fluidbook.menu.js @@ -20,7 +20,7 @@ FluidbookMenu.prototype = { $(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 div.multimedia:not(.notinteractive) iframe").length === 0; + let close = $(".mview[data-menu=multimedia] .multimediaScale div.multimedia:not(.notinteractive) iframe, .mview.pdfform").length === 0; return handleCloseView(e, close); }); @@ -1183,14 +1183,21 @@ FluidbookMenu.prototype = { break; case 'pdfform': this.initPDFViewer(); + iframe = m.find('iframe'); - seamless = iframe.hasClass('seamless'); - var pw = iframe.data('width') * 2; - var th = iframe.data('total-height') * 2; + if ($(iframe).length > 0) { + seamless = iframe.hasClass('seamless'); + var pw = iframe.data('width') * 2; + var th = iframe.data('total-height') * 2; + w = Math.min(pw, ww) + ratio = pw / th; + } else { + w = 500; + ratio=1; + } - w = Math.min(pw, ww) fullscreen = (w === ww); - ratio = pw / th; + ih = w / ratio; h = Math.min(ih, fullscreen ? hh : hh * 0.9); @@ -1234,6 +1241,7 @@ FluidbookMenu.prototype = { if (maxWidth > 0) { w = Math.min(maxWidth, w); } + console.log(maxWidth, w); css = {}; var ccss = {}; diff --git a/js/libs/fluidbook/menu/fluidbook.pdfform.js b/js/libs/fluidbook/menu/fluidbook.pdfform.js index 95cafdfa..b1258eb4 100644 --- a/js/libs/fluidbook/menu/fluidbook.pdfform.js +++ b/js/libs/fluidbook/menu/fluidbook.pdfform.js @@ -5,7 +5,8 @@ function FluidbookPDFForm(fluidbook) { FluidbookPDFForm.prototype = { init: function () { - $(document).on('click', '.mview[data-menu="pdfform"] .fonctions a.submit', function () { + let $this = this; + $(document).on('click', '.mview.pdfform .fonctions a.submit', function () { let linkId = $(this).closest('.mview').data('linkid'); let doc = $('.mview[data-menu="pdfform"] iframe').get(0).contentDocument; let fields = {}; @@ -28,15 +29,22 @@ FluidbookPDFForm.prototype = { let data = {fields: fields}; data.linkid = linkId; $this.fluidbook.service.call('pdfform', data, function (data) { + $this.confirmation(); }, undefined, 'POST'); return false; }); }, + confirmation: function () { + $('.mview.pdfform .content').html('
' + this.fluidbook.settings.pdfform_confirm + '
'); + $('.mview.pdfform').attr('data-max-width', 500); + this.fluidbook.resize.resize(); + }, + open: function (uid, callback) { let $this = this; var infos = this.fluidbook.settings.pdfLinks[uid]; - let c = this.getCaption('', 'nocaption', 'nocaption'); + let c = this.fluidbook.menu.getCaption('', 'nocaption', 'nocaption'); c += '
'; c += '
'; c += ''; c += '
'; - this.viewWrap(c, 'pdfform', 'data-linkid="' + uid + '"', 'pdfform ' + this.fluidbook.settings.pdfform_style); + this.fluidbook.menu.viewWrap(c, 'pdfform', 'data-linkid="' + uid + '"', 'pdfform ' + this.fluidbook.settings.pdfform_style); if (callback != undefined) { callback(); } diff --git a/style/menu-pdf.less b/style/menu-pdf.less index 836845b2..01801d23 100644 --- a/style/menu-pdf.less +++ b/style/menu-pdf.less @@ -24,6 +24,12 @@ } .mview.pdfform.cfgroup { + .confirmation { + font-size: 25px; + text-align: center; + padding: 50px; + } + .pdf-holder { padding-bottom: 100px; @media screen and (max-width: 800px) { -- 2.39.5