From 726921fe40a583c36f0188bc8d6afc73b5f8ff6c Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Thu, 2 Jul 2020 16:17:02 +0200 Subject: [PATCH] wip #3754 @3 --- js/libs/fluidbook/fluidbook.menu.js | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/js/libs/fluidbook/fluidbook.menu.js b/js/libs/fluidbook/fluidbook.menu.js index bfce9abb..604669e6 100644 --- a/js/libs/fluidbook/fluidbook.menu.js +++ b/js/libs/fluidbook/fluidbook.menu.js @@ -38,7 +38,7 @@ FluidbookMenu.prototype = { }, _openView: function (view, param1, param2, callback) { - console.log(view,param1,param2); + console.log(view, param1, param2); var $this = this; var preload = { index: 'thumbnails', @@ -193,7 +193,12 @@ FluidbookMenu.prototype = { view += markup; view += ''; - $("#view").append('
' + view + '
'); + var maxWidth = ''; + if ($(a).data('max-width')) { + maxWidth = ' data-max-width="' + $(a).data('max-width') + '"'; + } + + $("#view").append('
' + view + '
'); if (callback != undefined) { callback(); } @@ -596,6 +601,11 @@ FluidbookMenu.prototype = { $("#viewOverlay").css({width: ww, height: hh}); + var maxWidth = 100000; + if (m.data('max-width')) { + maxWidth = m.data('max-width'); + } + switch (m.data('menu')) { case 'chapters': this.fluidbook.settings.chaptersColumns = Math.max(1, Math.min(6, this.fluidbook.settings.chaptersColumns)); @@ -672,6 +682,8 @@ FluidbookMenu.prototype = { } forceHeight = true; + w = Math.min(w, maxWidth); + var iframe = $("#view .iframeHolder iframe"); iframe.css('width', w); try { @@ -914,7 +926,6 @@ FluidbookMenu.prototype = { } break; default: - var maxWidth = 10000; if (m.data('maxwidth') !== null) { maxWidth = parseInt(m.data('maxwidth')); } @@ -927,6 +938,8 @@ FluidbookMenu.prototype = { captionHeight += $(this).outerHeight(); }) + w = Math.min(maxWidth, w); + css = {}; ccss = {}; if (fullscreen) { @@ -940,6 +953,7 @@ FluidbookMenu.prototype = { m.removeClass('fs'); } + css.maxWidth = css.minWidth = css.width = w; css.maxHeight = h; -- 2.39.5