]> _ Git - fluidbook-html5.git/commitdiff
wip #5579 0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 17 Nov 2022 15:11:55 +0000 (16:11 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 17 Nov 2022 15:11:55 +0000 (16:11 +0100)
js/libs/fluidbook/fluidbook.links.js

index 87f4baa8255c92fd3d66656e591f258db1e0688e..8557a80c9e4e254e1ffa48ff955026d47e32a558 100644 (file)
@@ -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);