From: Vincent Vanwaelscappel Date: Fri, 5 Oct 2018 15:02:56 +0000 (+0200) Subject: wip #2228 @1.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=7470c24c381c452ea460804c2e30fe8ff14b2da8;p=fluidbook-html5.git wip #2228 @1.5 --- diff --git a/js/libs/fluidbook/fluidbook.links.js b/js/libs/fluidbook/fluidbook.links.js index 1a43cc90..518033c6 100644 --- a/js/libs/fluidbook/fluidbook.links.js +++ b/js/libs/fluidbook/fluidbook.links.js @@ -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 = '
'; - $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 = '
'; + $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 () { diff --git a/style/fluidbook.less b/style/fluidbook.less index 12355db6..71e5bae7 100644 --- a/style/fluidbook.less +++ b/style/fluidbook.less @@ -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; } }