]> _ Git - fluidbook-html5.git/commitdiff
wait #3382 @2
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 30 Jan 2020 16:28:33 +0000 (17:28 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 30 Jan 2020 16:28:33 +0000 (17:28 +0100)
js/libs/fluidbook/fluidbook.links.js
style/fluidbook.less

index 50486565998d431f90d27a679a6d8998d58b7907..f24d6845c67aa3ccdc11cc0b82365163cc73a879 100644 (file)
@@ -104,11 +104,20 @@ FluidbookLinks.prototype = {
             var mode = $(this).data('showmode');
 
             if (mode === 'exclusiveshow') {
-                $('div.link[data-hidden="1"].show').removeClass('show');
+                $('div.link[data-hidden="1"].show').each(function () {
+                    $this.hidePlacedLink(this);
+                });
             }
-            var l = $('div.link[data-id="' + $(this).data('showid') + '"');
+
+            var close = $(this).data('showclose');
+            var l = $('div.link[data-id="' + $(this).data('showid') + '"]');
+            $(l).append('<a href="#" class="linkshowclose ' + close + '"></a>');
             $(l).show();
             $(l).trigger('fluidbook.link.show');
+            if (close !== 'none') {
+                $(l).removeClass('notinteractive');
+                $(l).find('img').css('pointer-events', 'none');
+            }
             setTimeout(function () {
                 $(l).addClass('show');
             }, 10);
@@ -116,6 +125,14 @@ FluidbookLinks.prototype = {
             return false;
         });
 
+        $(document).on('click touchend', '.linkshowclose', function () {
+            var id = $(this).closest('[data-id]').data('id');
+            $('div.link[data-id="' + id + '"]').each(function () {
+                $this.hidePlacedLink(this);
+            });
+            return false;
+        });
+
         $(document).on('click touchend', '.textpopup', function () {
             $this.fluidbook.menu.__openView('text', $(this).data('text'), function () {
             });
@@ -158,6 +175,16 @@ FluidbookLinks.prototype = {
 
 
     },
+
+    hidePlacedLink: function (p) {
+        if ($(p).length === 0) {
+            return;
+        }
+        $(p).hide();
+        $(p).removeClass('show');
+        $(p).find('.linkshowclose').remove();
+    },
+
     initLinks: function (pageNr) {
 
         if (pageNr === undefined) {
@@ -480,7 +507,7 @@ FluidbookLinks.prototype = {
             el.removeClass('animating').css('opacity', '');
         }
 
-        var speed=0.5;
+        var speed = 0.5;
         var timeline = new TimelineMax();
         var repetitions = this.fluidbook.datas.linkBlinkRepetition - 1;
         el.addClass('animating');
index cc0b984298ddddfbc874825e63abfb110319e267..2075a2133a65d7e15e154a202a8177482389c845 100644 (file)
@@ -1211,6 +1211,29 @@ html.ios body.portrait #interface {
     pointer-events: none;
   }
 
+  .linkshowclose {
+    position: absolute;
+    display: block;
+    top: 0;
+
+    &.topleft, &.topright {
+      width: 200px;
+      height: 200px;
+    }
+
+    &.topleft {
+      left: 0;
+    }
+
+    &.topright {
+      right: 0;
+    }
+
+    &.none {
+      display: none;
+    }
+  }
+
   // Force images to take space provided (see: https://team.cubedesigners.com/redmine/issues/1457)
   > img.multimediaimage {
     width: 100%;