]> _ Git - fluidbook-html5.git/commitdiff
wip^#5250 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 4 May 2022 10:24:01 +0000 (12:24 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 4 May 2022 10:24:01 +0000 (12:24 +0200)
js/libs/fluidbook/fluidbook.links.js

index eb5bd3296e93d75bd42299fa0dd976cdd97423e9..0473e4ca317344193b2e4e2c3d41be2e2a2cb15f 100644 (file)
@@ -82,6 +82,7 @@ FluidbookLinks.prototype = {
             });
         });
 
+
         $(document).on(this.fluidbook.input.clickEvent, '[data-id] a', function () {
             var id = $(this).closest('[data-id]').attr('data-id');
             $this.fluidbook.contentlock.addAction(id, 'click');
@@ -89,6 +90,24 @@ FluidbookLinks.prototype = {
             return true;
         });
 
+        $(document).on('mouseover mouseout mouseenter mouseleave', '[data-related-animation]', function (e) {
+            var iframe = $('[data-id="' + $(this).data('related-animation') + '"] iframe');
+            if (iframe.length === 0) {
+                return true;
+            }
+            var iframeWindow = iframe.get(0).contentWindow;
+            var iframeDocument = iframeWindow.document;
+            var iframeLottie = iframeDocument.getElementById('lottie');
+
+            var event = new MouseEvent(e.type, {
+                'view': iframeWindow, 'bubbles': true, 'cancelable': true
+            });
+            console.log(iframeLottie);
+
+            iframeLottie.dispatchEvent(event);
+            return true;
+        });
+
         $(document).on(this.fluidbook.input.clickEvent, '.multimediaContainer[data-click-to-close="1"]', function () {
             $this.fluidbook.menu.closeView();
             return false;