]> _ Git - fluidbook-html5.git/commitdiff
wip #2228 @1.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 5 Oct 2018 15:02:56 +0000 (17:02 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 5 Oct 2018 15:02:56 +0000 (17:02 +0200)
js/libs/fluidbook/fluidbook.links.js
style/fluidbook.less

index 1a43cc90ba5e677dc3003d55280a176e7202f1fb..518033c660f173d58835a98876f3f4c975dae2e8 100644 (file)
@@ -87,6 +87,16 @@ FluidbookLinks.prototype = {
             return false;
         });
 
+        $(document).on('click touchend', '[data-showid]', function () {
+            var l = $('div.link[data-id="' + $(this).data('showid') + '"');
+            $(l).show();
+            $(l).trigger('fluidbook.link.show');
+            setTimeout(function () {
+                $(l).addClass('show');
+            }, 10);
+            return false;
+        });
+
         $(document).on('click touchend', '.textpopup', function () {
             $this.fluidbook.menu.__openView('text', $(this).data('text'), function () {
             });
@@ -180,8 +190,8 @@ FluidbookLinks.prototype = {
         if (linksContainer !== undefined) {
             container = $(linksContainer);
         }
-        if(additionalDelay===undefined){
-            additionalDelay=0;
+        if (additionalDelay === undefined) {
+            additionalDelay = 0;
         }
 
         var animateBookmarks = (this.fluidbook.datas.bookmarkBlinkOnPageChange == true);
@@ -205,7 +215,7 @@ FluidbookLinks.prototype = {
                         $(e).removeClass('animating').css('opacity', 1)
                     }
                 });
-            }, delay+additionalDelay);
+            }, delay + additionalDelay);
         });
 
 
@@ -522,28 +532,35 @@ FluidbookLinks.prototype = {
             clearInterval(interval);
         });
         $(".inlineslideshow").each(function () {
-            var $this = $(this);
-            var dir = 'data/links/' + $(this).data('dir') + '/';
-            $.each($(this).data('images'), function (k, i) {
-                var h = '<div class="slide" style="background-image: url(\'' + dir + i + '\');"></div>';
-                $this.append(h);
-            });
+            if ($(this).is(':visible')) {
+                $__this.initSlideshow(this);
+            }else{
 
-            setTimeout(function () {
-                $this.find('.slide:eq(0)').addClass('show');
-            }, 1000);
-
-            $__this.initInlineSlideshowsIntervals.push(setInterval(function () {
-                var current = $this.find('.slide.show');
-                var next = $(current).nextAll('.slide:not(.show):eq(0)');
-                if ($(next).length == 0) {
-                    next = $this.find('.slide:eq(0)');
-                }
+            }
+        });
+    },
 
-                $(next).addClass('show');
-                $(current).removeClass('show');
-            }, parseFloat($__this.fluidbook.datas.inlineSlideshowDuration) * 1000));
+    initSlideshow: function (s) {
+        var dir = 'data/links/' + $(s).data('dir') + '/';
+        $.each($(s).data('images'), function (k, i) {
+            var h = '<div class="slide" style="background-image: url(\'' + dir + i + '\');"></div>';
+            $this.append(h);
         });
+
+        setTimeout(function () {
+            s.find('.slide:eq(0)').addClass('show');
+        }, 1000);
+
+        this.initInlineSlideshowsIntervals.push(setInterval(function () {
+            var current = s.find('.slide.show');
+            var next = $(current).nextAll('.slide:not(.show):eq(0)');
+            if ($(next).length == 0) {
+                next = s.find('.slide:eq(0)');
+            }
+
+            $(next).addClass('show');
+            $(current).removeClass('show');
+        }, parseFloat(this.fluidbook.datas.inlineSlideshowDuration) * 1000));
     },
 
     resize: function () {
index 12355db605eae354bdcf2ffed5a703b847a2280c..71e5bae7d1b88b4b35cd0c3eea16a609815d66ef 100644 (file)
@@ -1127,6 +1127,17 @@ html.ios body.portrait #interface {
        }
 }
 
+.link {
+       &[data-hidden="1"] {
+               transition: opacity 1s;
+               display: none;
+               opacity: 0;
+               &.show {
+                       opacity: 1;
+               }
+       }
+}
+
 .link.contentLink {
        z-index: 0 !important;
        position: absolute;
@@ -1162,7 +1173,6 @@ html.ios body.portrait #interface {
        cursor: zoom-in;
 }
 
-
 /* Bookmarks */
 .bookmark {
 
@@ -1292,9 +1302,9 @@ html.ios body.portrait #interface {
                }
        }
 
-       &[data-menu="text"]{
-               >.content>.text{
-                       li{
+       &[data-menu="text"] {
+               > .content > .text {
+                       li {
                                list-style-position: outside;
                                margin-left: 1em;
                        }
@@ -1985,11 +1995,11 @@ ul.chapters.shareList a.level0 .svg-icon {
                }
        }
 
-       .links{
+       .links {
                position: absolute;
                top: 0;
                left: 0;
-               .link{
+               .link {
                        position: absolute;
                }
        }