From: Vincent Vanwaelscappel Date: Fri, 20 Nov 2020 20:44:59 +0000 (+0100) Subject: wip #4083 @1 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=2c4c517b6b1b54f5b725cb9c69756ea05c2dfbc4;p=fluidbook-html5.git wip #4083 @1 --- diff --git a/js/libs/fluidbook/fluidbook.links.js b/js/libs/fluidbook/fluidbook.links.js index 710c7341..40245e9a 100644 --- a/js/libs/fluidbook/fluidbook.links.js +++ b/js/libs/fluidbook/fluidbook.links.js @@ -741,6 +741,7 @@ FluidbookLinks.prototype = { initInlineSlideshows: function () { var $this = this; + this.fluidbook.slideshow.clear(); $(".inlineslideshow").each(function () { if ($(this).is(':visible')) { $this.fluidbook.slideshow.initInlineSlideshow($(this)); diff --git a/js/libs/fluidbook/slideshow/fluidbook.slideshow.dummy.js b/js/libs/fluidbook/slideshow/fluidbook.slideshow.dummy.js index 08d24a14..7273de15 100644 --- a/js/libs/fluidbook/slideshow/fluidbook.slideshow.dummy.js +++ b/js/libs/fluidbook/slideshow/fluidbook.slideshow.dummy.js @@ -4,7 +4,16 @@ function FluidbookDummySlideshow(fluidbook) { } FluidbookDummySlideshow.prototype = { + clear: function () { + $.each(this.intervals, function (k, v) { + clearInterval(v); + }); + }, + initSlideshow: function (s) { + if ($(s).data('init') === true) { + return; + } var $this = this; s.data('init', true); var dir = 'data/links/' + $(s).data('dir') + '/'; @@ -30,7 +39,7 @@ FluidbookDummySlideshow.prototype = { $(current).removeClass('show').css('display', 'none'); $(this).css({zIndex: ''}); }); - }, 100); + }, 200); }, parseFloat(this.fluidbook.settings.inlineSlideshowDuration) * 1000)); }, diff --git a/js/libs/fluidbook/slideshow/fluidbook.slideshow.js b/js/libs/fluidbook/slideshow/fluidbook.slideshow.js index 1379a214..bc7de5a4 100644 --- a/js/libs/fluidbook/slideshow/fluidbook.slideshow.js +++ b/js/libs/fluidbook/slideshow/fluidbook.slideshow.js @@ -39,6 +39,19 @@ FluidbookSlideshow.prototype = { return $(s); }, + clear: function () { + try { + this.inlineInstance.clear(); + } catch (e) { + + } + try { + this.popupInstance.clear(); + } catch (e) { + + } + }, + initPopupSlideshow: function (s) { var s = this.normalizeSlideshowElement(s); this.popupInstance.initSlideshow(s); diff --git a/style/fluidbook.less b/style/fluidbook.less index 03ebb41d..d06b86fa 100644 --- a/style/fluidbook.less +++ b/style/fluidbook.less @@ -2859,34 +2859,6 @@ body > input { } } -.inlineslideshow { - width: 100%; - height: 100%; - max-width: 100%; - max-height: 100%; - overflow: hidden; - - .slide { - display: none; - width: 100%; - height: 100%; - background-size: cover; - background-position: 50% 50%; - opacity: 0; - - position: absolute; - top: 0; - left: 0; - z-index: 0; - - &.show { - z-index: 1; - opacity: 1; - transition: opacity @inlineslideshow-transition-time; - } - } -} - #links .fb_iframe_widget { transform-origin: 0 0 0; transform: scale(2.5); diff --git a/style/slideshow/dummy.less b/style/slideshow/dummy.less index e69de29b..a90c2617 100644 --- a/style/slideshow/dummy.less +++ b/style/slideshow/dummy.less @@ -0,0 +1,30 @@ +@import "../variables"; + +.inlineslideshow { + width: 100%; + height: 100%; + max-width: 100%; + max-height: 100%; + overflow: hidden; + + .slide { + display: none; + width: 100%; + height: 100%; + background-size: cover; + background-position: 50% 50%; + + opacity: 0; + position: absolute; + top: 0; + left: 0; + z-index: 0; + + + &.show { + transition: opacity @inlineslideshow-transition-time; + z-index: 1; + opacity: 1; + } + } +} \ No newline at end of file diff --git a/style/slideshow/splide.less b/style/slideshow/splide.less index c9e216cc..aeac61b5 100644 --- a/style/slideshow/splide.less +++ b/style/slideshow/splide.less @@ -1,3 +1,5 @@ +@import "../variables"; + // Splide JS Styling (adapted from SCSS) @main-color: @menu-select-background; @light-main-color: lighten(@main-color, 20%); diff --git a/style/slideshow/vacheron.less b/style/slideshow/vacheron.less index e69de29b..916afb4c 100644 --- a/style/slideshow/vacheron.less +++ b/style/slideshow/vacheron.less @@ -0,0 +1 @@ +@import "../variables"; \ No newline at end of file