]> _ Git - fluidbook-html5.git/commitdiff
wait #5578 @0.75
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 17 Nov 2022 14:18:20 +0000 (15:18 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 17 Nov 2022 14:18:20 +0000 (15:18 +0100)
js/libs/fluidbook/fluidbook.links.js

index 466907421e78ce297ff2224b78f608ffe61ba0d3..87f4baa8255c92fd3d66656e591f258db1e0688e 100644 (file)
@@ -30,7 +30,6 @@ FluidbookLinks.prototype = {
         this.jumpToPageContainingLink = true;
         var $this = this;
 
-
         if (this.fluidbook.settings.phonegap === 'ios') {
             $(document).on('touchstart touchend click', 'a.clickonly', function (e) {
                 var cancel = function (e) {
@@ -66,7 +65,6 @@ FluidbookLinks.prototype = {
 
         this.lowdef = this.fluidbook.support.android || this.fluidbook.support.iOS;
 
-
         $(this.fluidbook).on('fluidbook.page.change.end', function () {
             if ($this.lastTriggeredLinksPage == $this.fluidbook.currentPage) {
                 return;
@@ -91,7 +89,6 @@ FluidbookLinks.prototype = {
             });
         });
 
-
         $(document).on(this.fluidbook.input.clickEvent, '[data-id] a', function () {
             var id = $(this).closest('[data-id]').attr('data-id');
             $this.fluidbook.contentlock.addAction(id, 'click');
@@ -283,6 +280,13 @@ 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
+                if ($(this).is('[data-showid]')) {
+                    hide = $(this).data('showid').split(',');
+                } else {
+                    hide = 'all';
+                }
                 $.each(showid, function (k, id) {
                     selector += ':not([data-id$="' + id + '"])';
                 });
@@ -291,7 +295,10 @@ FluidbookLinks.prototype = {
                     if ($(selector).is('[data-animation-hide]')) {
                         timeout = 0;
                     }
-                    $this.hidePlacedLink(this, timeout);
+                    var id = $(this).data('id');
+                    if (hide === 'all' || hide.indexOf(id) >= 0) {
+                        $this.hidePlacedLink(this, timeout);
+                    }
                 });
             }