]> _ Git - fluidbook-html5.git/commitdiff
wip #3519 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 20 Mar 2020 14:15:57 +0000 (15:15 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 20 Mar 2020 14:15:57 +0000 (15:15 +0100)
js/libs/fluidbook/fluidbook.links.js

index 714a1c899a9310596ee08d71f1c0366a716fcee2..e2a1e2cd99e55b11cf82e0e3d836b5cffed20326 100644 (file)
@@ -103,12 +103,21 @@ FluidbookLinks.prototype = {
         $(document).on('click touchend', '[data-showid]', function () {
             var mode = $(this).data('showmode');
 
+            if (mode === 'toggle') {
+                var l = $('div.link[data-id="' + $(this).data('showid') + '"].show');
+                if (l.length > 0) {
+                    l.removeClass('show');
+                    return false;
+                }
+            }
+
             if (mode === 'exclusiveshow') {
                 $('div.link[data-hidden="1"].show').each(function () {
                     $this.hidePlacedLink(this);
                 });
             }
 
+
             var close = $(this).data('showclose');
             var l = $('div.link[data-id="' + $(this).data('showid') + '"]');
             $(l).append('<a href="#" class="linkshowclose ' + close + '"></a>');
@@ -567,8 +576,8 @@ FluidbookLinks.prototype = {
     triggerLinkById: function (id) {
         var a = $('.link[data-id="' + id + '"] a:eq(0)');
         a.get(0).click();
-    }
-    ,
+    },
+
     initInlineSlideshows: function () {
         var $__this = this;