]> _ Git - fluidbook-html5.git/commitdiff
wait #5246 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 3 May 2022 10:37:24 +0000 (12:37 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 3 May 2022 10:37:24 +0000 (12:37 +0200)
js/libs/fluidbook/fluidbook.links.js

index 3d19964e45fb5e25686aca5f372e82bab188c7af..eb5bd3296e93d75bd42299fa0dd976cdd97423e9 100644 (file)
@@ -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('<a href="#" class="linkshowclose ' + close + '"></a>');
                     }
+                    $(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');