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

index 8557a80c9e4e254e1ffa48ff955026d47e32a558..77f280fe83a71b4ef34be723c4b59bfa012078f0 100644 (file)
@@ -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);
     },
 
index 1c240c4148fdd9be7f9d42b1e97d8aed43231687..ecce5004349f221749a9c3704f278c7138d38d6b 100644 (file)
@@ -1461,7 +1461,7 @@ html.ios body.portrait #interface {
 
 .link {
   &[data-hidden="1"] {
-    transition: opacity 1s;
+    transition: opacity 750ms;
     visibility: hidden;
     opacity: 0;