$(window).on('resize', function () {
resize();
});
+ setInterval(function () {
+ $this.checkOrientation();
+ }, 1000);
} else {
if ("onorientationchange" in window) {
window.addEventListener('orientationchange', function () {
var o = this.getOrientation();
if (o != this._orientation) {
this._orientation = o;
+ $(this.fluidbook).trigger('fluidbook.orientationchange');
resize();
}
}, getOrientation: function () {
function FluidbookDummySlideshow(fluidbook) {
this.fluidbook = fluidbook;
-
+ this.intervalHandle = null;
+ this.timeoutHandle = null;
+ this.initEvents();
}
FluidbookDummySlideshow.prototype = {
- clear: function () {
+
+ initEvents: function () {
+ var $this = this;
+ $(this.fluidbook).on('fluidbook.orientationchange', function () {
+ setTimeout(function () {
+ if ($this.fluidbook.support.getOrientation() === 90) {
+ $('.fb-slideshow-wrapper.dummy.fb-slideshow-inline .fb-slideshow').each(function () {
+ if ($(this).data('init') === true) {
+ $this.launchSlideshow($(this));
+ } else {
+ $this.initSlideshow($(this));
+ }
+ });
+ }
+ }, 2000);
+ });
+ },
+
+ clear: function (s) {
+ if ($(s).data('intervalHandle') !== undefined) {
+ clearRequestInterval($(s).data('intervalHandle'));
+ }
+ if ($(s).data('timeoutHandle') !== undefined) {
+ clearRequestTimeout($(s).data('timeoutHandle'));
+ }
},
initSlideshow: function (s) {
}
var holder = $(s).find('.splide__list');
- var $this = this;
s.data('init', true);
// Move first to end
holder.append(holder.find('.fb-slideshow-slide:eq(0)'));
- requestInterval(
+ this.launchSlideshow($(s));
+ },
+
+ launchSlideshow: function (s) {
+ this.clear(s);
+ var holder = $(s).find('.splide__list');
+ var $this = this;
+ holder.find('.fb-slideshow-slide').removeClass('show');
+ holder.find('.fb-slideshow-slide:eq(0)').addClass('show')
+ $(s).data('intervalHandle', requestInterval(
function () {
if (!$(holder).is(':visible')) {
return;
}
$(next).css({display: 'block', zIndex: 2});
- requestTimeout(function () {
+ $(s).data('timeoutHandle', requestTimeout(function () {
$(next).addClass('show').one($this.fluidbook.support.getTransitionEndEvent(), function () {
$(holder).find('.fb-slideshow-slide.show').not(next).removeClass('show').css('display', 'none');
$(this).css({zIndex: '', display: ''});
});
- }, 200);
+ }, 200));
- }, parseFloat(this.fluidbook.settings.inlineSlideshowDuration) * 1000);
+ }, parseFloat($this.fluidbook.settings.inlineSlideshowDuration) * 1000)
+ );
},
resizeInline() {