From: Vincent Vanwaelscappel Date: Thu, 17 Nov 2022 16:30:59 +0000 (+0100) Subject: wait #5579 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=3d88126c67cc67ec6e5f3d5e5ff3ea3e0a4a4347;p=fluidbook-html5.git wait #5579 @0.5 --- diff --git a/js/libs/fluidbook/fluidbook.links.js b/js/libs/fluidbook/fluidbook.links.js index 8557a80c..77f280fe 100644 --- a/js/libs/fluidbook/fluidbook.links.js +++ b/js/libs/fluidbook/fluidbook.links.js @@ -15,6 +15,7 @@ function FluidbookLinks(fluidbook) { this.fluidbook = fluidbook; + this.showLinkAnimating = false; this.lastTriggeredLinksPage = -1; try { this.zoom = new FluidbookLinksZoom(fluidbook); @@ -223,7 +224,13 @@ FluidbookLinks.prototype = { }); $(document).on(this.fluidbook.input.clickEvent, '[data-showid]:not([data-showmode="showonhover"])', function () { - + if ($this.showLinkAnimating) { + return false; + } + $this.showLinkAnimating = true; + setTimeout(function () { + $this.showLinkAnimating = false; + }, 1000); var mode = $(this).data('showmode'); var ids = $(this).data('showid').toString().split(','); @@ -258,6 +265,15 @@ FluidbookLinks.prototype = { } var current = $(this).data('current-showid'); + if (current === undefined) { + $.each(ids, function (k, id) { + if ($('[data-id="' + id + '"].show').length > 0) { + current = id; + console.log(current); + } + } + ); + } if (current === undefined) { showid = [ids[0]]; } else { @@ -279,6 +295,7 @@ FluidbookLinks.prototype = { } if (mode === 'exclusiveshow' || mode === 'shownext' || mode === 'shownextcycle' || mode === 'showprev' || mode === 'showprevcycle' || mode === 'pickrandom') { + var selector = 'div.link[data-hidden="1"].show'; var hide = []; // Only hide links that are in the list @@ -304,7 +321,7 @@ FluidbookLinks.prototype = { selector += ':not([data-id$="' + id + '"])'; }); $(selector).each(function () { - var timeout = (mode === 'shownext' || mode === 'shownextcycle' || mode === 'showprev' || mode === 'showprevcycle') ? 1000 : 0; + var timeout = (mode === 'shownext' || mode === 'shownextcycle' || mode === 'showprev' || mode === 'showprevcycle') ? 900 : 0; if ($(selector).is('[data-animation-hide]')) { timeout = 0; } @@ -523,7 +540,7 @@ FluidbookLinks.prototype = { $(p).find('.linkshowclose').remove(); setTimeout(function () { $(p).hide(); - }, 1000) + }, 500) }, timeout); }, diff --git a/style/fluidbook.less b/style/fluidbook.less index 1c240c41..ecce5004 100644 --- a/style/fluidbook.less +++ b/style/fluidbook.less @@ -1461,7 +1461,7 @@ html.ios body.portrait #interface { .link { &[data-hidden="1"] { - transition: opacity 1s; + transition: opacity 750ms; visibility: hidden; opacity: 0;