From: Vincent Vanwaelscappel Date: Thu, 10 Jan 2019 15:09:10 +0000 (+0100) Subject: fix #2503 @2 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=8ff874d98134741ad74bf9591132db4ccc547548;p=fluidbook-html5.git fix #2503 @2 --- diff --git a/js/libs/fluidbook/fluidbook.menu.js b/js/libs/fluidbook/fluidbook.menu.js index 2995573a..bc2b47cf 100644 --- a/js/libs/fluidbook/fluidbook.menu.js +++ b/js/libs/fluidbook/fluidbook.menu.js @@ -178,6 +178,7 @@ FluidbookMenu.prototype = { }, openIframe: function (iframe, callback) { + var $this = this; var a = $('a[href="#/iframe/' + iframe + '"]'); var markup = decodeURIComponent($(a).attr('data-iframe')); var view = '
' + this.closeButton() + '
'; @@ -189,6 +190,13 @@ FluidbookMenu.prototype = { if (callback != undefined) { callback(); } + + var t = $("#view .iframeContainer").data('type'); + $("#view").find('.iframeHolder,.content,.mview').attr('data-type', t); + + $("#view .iframeContainer iframe").on('load', function () { + $this.resize(); + }); }, openVideo: function (video, callback) { @@ -617,6 +625,22 @@ FluidbookMenu.prototype = { fullscreen = true; } forceHeight = true; + + var iframe = $("#view .iframeHolder iframe"); + iframe.css('width', w); + if (!fullscreen) { + var ih = -1; + try { + ih = $(iframe).get(0).contentWindow.document.body.offsetHeight; + } catch (e) { + ih = -1; + } + + if (ih > 0) { + h = Math.min(ih, h); + } + } + break; case 'cart': w = 1024;