From: Vincent Vanwaelscappel Date: Tue, 13 Apr 2021 10:30:32 +0000 (+0200) Subject: wait #4400 @0.25 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=66250b111e318e7c6086112cdec5ce6daac2e634;p=fluidbook-html5.git wait #4400 @0.25 --- diff --git a/js/libs/fluidbook/fluidbook.links.js b/js/libs/fluidbook/fluidbook.links.js index b9cbaba5..7da4edad 100644 --- a/js/libs/fluidbook/fluidbook.links.js +++ b/js/libs/fluidbook/fluidbook.links.js @@ -49,7 +49,7 @@ FluidbookLinks.prototype = { }); $(document).on('click touchend', '[data-id] a', function () { - var id=$(this).closest('[data-id]').attr('data-id'); + var id = $(this).closest('[data-id]').attr('data-id'); $this.fluidbook.contentlock.addAction(id, 'click'); $this.fluidbook.gamify.linkClicked(id); return true; @@ -198,7 +198,7 @@ FluidbookLinks.prototype = { var close = $(this).data('showclose'); $('div.link[data-id$="' + showid + '"]').each(function () { var l = this; - if(close!=='none') { + if (close !== 'none') { $(l).append(''); } $(l).show(); @@ -314,7 +314,7 @@ FluidbookLinks.prototype = { return u.href; }, - showLinkById:function(id) { + showLinkById: function (id) { var s = $('div.link[data-id="' + id + '"]'); s.show(); setTimeout(function () { @@ -323,7 +323,7 @@ FluidbookLinks.prototype = { }, - hideLinkById:function(id) { + hideLinkById: function (id) { var s = $('div.link[data-id="' + id + '"]'); if ($(s).attr('data-hidden') != '1') { $(s).attr('data-hidden', '1').addClass('show'); @@ -854,13 +854,20 @@ FluidbookLinks.prototype = { resize: function () { var $this = this; $("#links .link.iframe").each(function () { + var iframe = $(this).find("iframe"); + var scale = $(iframe).data('scale'); var w = $(this).outerWidth(); var h = $(this).outerHeight(); var iw = w * $this.fluidbook.resize.bookScale; var ih = h * $this.fluidbook.resize.bookScale; - $(this).find("iframe").attr("width", iw) - .attr('height', ih) - .css({width: iw, height: ih, transform: 'scale(' + (1 / $this.fluidbook.resize.bookScale) + ')'}); + if (scale !== 'no') { + if(scale==='auto') { + scale = (1 / $this.fluidbook.resize.bookScale); + } + $(iframe).attr("width", iw) + .attr('height', ih) + .css({width: iw, height: ih, transform: 'scale(' + scale + ')'}); + } }); },