From: Vincent Vanwaelscappel Date: Wed, 4 May 2022 10:24:01 +0000 (+0200) Subject: wip^#5250 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=561d6d2d779793204c5030fdea1e60e311146f10;p=fluidbook-html5.git wip^#5250 @0.5 --- diff --git a/js/libs/fluidbook/fluidbook.links.js b/js/libs/fluidbook/fluidbook.links.js index eb5bd329..0473e4ca 100644 --- a/js/libs/fluidbook/fluidbook.links.js +++ b/js/libs/fluidbook/fluidbook.links.js @@ -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;