From: Vincent Vanwaelscappel Date: Tue, 3 May 2022 10:37:24 +0000 (+0200) Subject: wait #5246 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=067d24dc376cb2d0998e2d9f311f78d8ad2cc70b;p=fluidbook-html5.git wait #5246 @0.5 --- diff --git a/js/libs/fluidbook/fluidbook.links.js b/js/libs/fluidbook/fluidbook.links.js index 3d19964e..eb5bd329 100644 --- a/js/libs/fluidbook/fluidbook.links.js +++ b/js/libs/fluidbook/fluidbook.links.js @@ -207,7 +207,7 @@ FluidbookLinks.prototype = { if (mode === 'toggle') { $.each(ids, function (k, id) { - console.log('toggle '+id); + console.log('toggle ' + id); $('div.link[data-id$="' + id + '"]').toggleClass('show'); }); return false; @@ -267,12 +267,18 @@ FluidbookLinks.prototype = { $(l).addClass('forceinteractive'); $(l).append(''); } + $(l).find('iframe').each(function () { + $(this).attr('data-src', $(this).attr('src')); + $(this).attr('src', ''); + }); $(l).show(); - if ($(l).find('iframe').length > 0) { + setTimeout(function () { $(l).find('iframe').each(function () { - this.src = this.src; + $(this).attr('src', $(this).attr('data-src')); }); - } + }, 10); + + $(l).trigger('fluidbook.link.show'); if (close !== 'none') { $(l).removeClass('notinteractive');