From: Vincent Vanwaelscappel Date: Thu, 30 Jan 2020 16:28:33 +0000 (+0100) Subject: wait #3382 @2 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=9a141683e32faf4e9881c9a5919c8e803b58d7b5;p=fluidbook-html5.git wait #3382 @2 --- diff --git a/js/libs/fluidbook/fluidbook.links.js b/js/libs/fluidbook/fluidbook.links.js index 50486565..f24d6845 100644 --- a/js/libs/fluidbook/fluidbook.links.js +++ b/js/libs/fluidbook/fluidbook.links.js @@ -104,11 +104,20 @@ FluidbookLinks.prototype = { var mode = $(this).data('showmode'); if (mode === 'exclusiveshow') { - $('div.link[data-hidden="1"].show').removeClass('show'); + $('div.link[data-hidden="1"].show').each(function () { + $this.hidePlacedLink(this); + }); } - var l = $('div.link[data-id="' + $(this).data('showid') + '"'); + + var close = $(this).data('showclose'); + var l = $('div.link[data-id="' + $(this).data('showid') + '"]'); + $(l).append(''); $(l).show(); $(l).trigger('fluidbook.link.show'); + if (close !== 'none') { + $(l).removeClass('notinteractive'); + $(l).find('img').css('pointer-events', 'none'); + } setTimeout(function () { $(l).addClass('show'); }, 10); @@ -116,6 +125,14 @@ FluidbookLinks.prototype = { return false; }); + $(document).on('click touchend', '.linkshowclose', function () { + var id = $(this).closest('[data-id]').data('id'); + $('div.link[data-id="' + id + '"]').each(function () { + $this.hidePlacedLink(this); + }); + return false; + }); + $(document).on('click touchend', '.textpopup', function () { $this.fluidbook.menu.__openView('text', $(this).data('text'), function () { }); @@ -158,6 +175,16 @@ FluidbookLinks.prototype = { }, + + hidePlacedLink: function (p) { + if ($(p).length === 0) { + return; + } + $(p).hide(); + $(p).removeClass('show'); + $(p).find('.linkshowclose').remove(); + }, + initLinks: function (pageNr) { if (pageNr === undefined) { @@ -480,7 +507,7 @@ FluidbookLinks.prototype = { el.removeClass('animating').css('opacity', ''); } - var speed=0.5; + var speed = 0.5; var timeline = new TimelineMax(); var repetitions = this.fluidbook.datas.linkBlinkRepetition - 1; el.addClass('animating'); diff --git a/style/fluidbook.less b/style/fluidbook.less index cc0b9842..2075a213 100644 --- a/style/fluidbook.less +++ b/style/fluidbook.less @@ -1211,6 +1211,29 @@ html.ios body.portrait #interface { pointer-events: none; } + .linkshowclose { + position: absolute; + display: block; + top: 0; + + &.topleft, &.topright { + width: 200px; + height: 200px; + } + + &.topleft { + left: 0; + } + + &.topright { + right: 0; + } + + &.none { + display: none; + } + } + // Force images to take space provided (see: https://team.cubedesigners.com/redmine/issues/1457) > img.multimediaimage { width: 100%;