From: Vincent Vanwaelscappel Date: Thu, 17 Nov 2022 15:11:55 +0000 (+0100) Subject: wip #5579 0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=bf0c212b00c2ae7ab2bc143ac7ef380c36916f39;p=fluidbook-html5.git wip #5579 0.5 --- diff --git a/js/libs/fluidbook/fluidbook.links.js b/js/libs/fluidbook/fluidbook.links.js index 87f4baa8..8557a80c 100644 --- a/js/libs/fluidbook/fluidbook.links.js +++ b/js/libs/fluidbook/fluidbook.links.js @@ -284,6 +284,19 @@ FluidbookLinks.prototype = { // Only hide links that are in the list if ($(this).is('[data-showid]')) { hide = $(this).data('showid').split(','); + var maxZindex = 0; + $.each(hide, function (k, hideid) { + var e = $('[data-id="' + hideid + '"]'); + var zIndex; + if ($(e).is('[data-zindex]')) { + zIndex = $(e).attr('data-zindex'); + } else { + zIndex = $(e).css('z-index'); + $(e).attr('data-zindex', zIndex); + } + + maxZindex = Math.max(parseInt(zIndex), maxZindex); + }); } else { hide = 'all'; } @@ -291,12 +304,15 @@ FluidbookLinks.prototype = { selector += ':not([data-id$="' + id + '"])'; }); $(selector).each(function () { - var timeout = (mode === 'shownext' || mode === 'shownextcycle') ? 500 : 0; + var timeout = (mode === 'shownext' || mode === 'shownextcycle' || mode === 'showprev' || mode === 'showprevcycle') ? 1000 : 0; if ($(selector).is('[data-animation-hide]')) { timeout = 0; } var id = $(this).data('id'); if (hide === 'all' || hide.indexOf(id) >= 0) { + if ($(this).is('[data-zindex]')) { + $(this).css('z-index', $(this).data('zindex')); + } $this.hidePlacedLink(this, timeout); } }); @@ -326,6 +342,12 @@ FluidbookLinks.prototype = { $(l).removeClass('notinteractive'); $(l).find('img').css('pointer-events', 'none'); } + + console.log(maxZindex); + if (maxZindex !== undefined) { + $(l).css('z-index', maxZindex + 1) + } + setTimeout(function () { if ($(l).is('[data-animation-hide]') && !$(l).hasClass('show')) { $this.animateContentLink($(l), true, true);