Updated the footable Lib.
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
/*! UIkit 2.21.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
(function(addon) {
|
||||
|
||||
var component;
|
||||
@ -40,7 +40,7 @@
|
||||
'uk-animation-top-center',
|
||||
'', // middle-center
|
||||
'uk-animation-bottom-right'
|
||||
],
|
||||
]
|
||||
},
|
||||
|
||||
current : false,
|
||||
@ -57,7 +57,7 @@
|
||||
var slideshow = UI.$(this);
|
||||
|
||||
if (!slideshow.data("slideshow")) {
|
||||
var obj = UI.slideshow(slideshow, UI.Utils.options(slideshow.attr("data-uk-slideshow")));
|
||||
UI.slideshow(slideshow, UI.Utils.options(slideshow.attr("data-uk-slideshow")));
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -105,7 +105,14 @@
|
||||
|
||||
var cover = UI.$('<div class="uk-cover-background uk-position-cover"></div>').css({'background-image':'url('+ media.attr('src') + ')'});
|
||||
|
||||
media.css({'width': '100%','height': 'auto'});
|
||||
if (media.attr('width') && media.attr('height')) {
|
||||
placeholder = UI.$('<canvas></canvas>').attr({width:media.attr('width'), height:media.attr('height')});
|
||||
media.replaceWith(placeholder);
|
||||
media = placeholder;
|
||||
placeholder = undefined;
|
||||
}
|
||||
|
||||
media.css({width: '100%',height: 'auto', opacity:0});
|
||||
slide.prepend(cover).data('cover', cover);
|
||||
break;
|
||||
|
||||
@ -179,7 +186,7 @@
|
||||
}
|
||||
});
|
||||
|
||||
this.on("click.uikit.slideshow", '[data-uk-slideshow-item]', function(e) {
|
||||
this.on("click.uk.slideshow", '[data-uk-slideshow-item]', function(e) {
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
@ -257,7 +264,7 @@
|
||||
|
||||
if (this.container.hasClass('uk-slideshow-fullscreen')) return;
|
||||
|
||||
var $this = this, height = this.options.height;
|
||||
var height = this.options.height;
|
||||
|
||||
if (this.options.height === 'auto') {
|
||||
|
||||
@ -281,7 +288,7 @@
|
||||
var $this = this,
|
||||
current = this.slides.eq(this.current),
|
||||
next = this.slides.eq(index),
|
||||
dir = direction ? direction : this.current < index ? -1 : 1,
|
||||
dir = direction ? direction : this.current < index ? 1 : -1,
|
||||
currentmedia = current.data('media'),
|
||||
animation = Animations[this.options.animation] ? this.options.animation : 'fade',
|
||||
nextmedia = next.data('media'),
|
||||
@ -305,7 +312,7 @@
|
||||
|
||||
UI.Utils.checkDisplay(next, '[class*="uk-animation-"]:not(.uk-cover-background.uk-position-cover)');
|
||||
|
||||
$this.trigger('show.uk.slideshow', [next]);
|
||||
$this.trigger('show.uk.slideshow', [next, current, $this]);
|
||||
};
|
||||
|
||||
$this.applyKenBurns(next);
|
||||
@ -318,6 +325,8 @@
|
||||
current = UI.$(current);
|
||||
next = UI.$(next);
|
||||
|
||||
$this.trigger('beforeshow.uk.slideshow', [next, current, $this]);
|
||||
|
||||
Animations[animation].apply(this, [current, next, dir]).then(finalize);
|
||||
|
||||
$this.triggers.removeClass('uk-active');
|
||||
@ -345,11 +354,11 @@
|
||||
},
|
||||
|
||||
next: function() {
|
||||
this.show(this.slides[this.current + 1] ? (this.current + 1) : 0);
|
||||
this.show(this.slides[this.current + 1] ? (this.current + 1) : 0, 1);
|
||||
},
|
||||
|
||||
previous: function() {
|
||||
this.show(this.slides[this.current - 1] ? (this.current - 1) : (this.slides.length - 1));
|
||||
this.show(this.slides[this.current - 1] ? (this.current - 1) : (this.slides.length - 1), -1);
|
||||
},
|
||||
|
||||
start: function() {
|
||||
@ -435,14 +444,14 @@
|
||||
|
||||
next.css('opacity', 1).one(UI.support.animation.end, function() {
|
||||
|
||||
current.removeClass(dir === 1 ? 'uk-slideshow-scroll-backward-out' : 'uk-slideshow-scroll-forward-out');
|
||||
next.css('opacity', '').removeClass(dir === 1 ? 'uk-slideshow-scroll-backward-in' : 'uk-slideshow-scroll-forward-in');
|
||||
current.removeClass(dir == -1 ? 'uk-slideshow-scroll-backward-out' : 'uk-slideshow-scroll-forward-out');
|
||||
next.css('opacity', '').removeClass(dir == -1 ? 'uk-slideshow-scroll-backward-in' : 'uk-slideshow-scroll-forward-in');
|
||||
d.resolve();
|
||||
|
||||
}.bind(this));
|
||||
|
||||
current.addClass(dir == 1 ? 'uk-slideshow-scroll-backward-out' : 'uk-slideshow-scroll-forward-out');
|
||||
next.addClass(dir == 1 ? 'uk-slideshow-scroll-backward-in' : 'uk-slideshow-scroll-forward-in');
|
||||
current.addClass(dir == -1 ? 'uk-slideshow-scroll-backward-out' : 'uk-slideshow-scroll-forward-out');
|
||||
next.addClass(dir == -1 ? 'uk-slideshow-scroll-backward-in' : 'uk-slideshow-scroll-forward-in');
|
||||
next.width(); // force redraw
|
||||
|
||||
return d.promise();
|
||||
@ -457,14 +466,14 @@
|
||||
|
||||
next.css('opacity', 1).one(UI.support.animation.end, function() {
|
||||
|
||||
current.removeClass(dir === 1 ? 'uk-slideshow-swipe-backward-out' : 'uk-slideshow-swipe-forward-out');
|
||||
next.css('opacity', '').removeClass(dir === 1 ? 'uk-slideshow-swipe-backward-in' : 'uk-slideshow-swipe-forward-in');
|
||||
current.removeClass(dir === -1 ? 'uk-slideshow-swipe-backward-out' : 'uk-slideshow-swipe-forward-out');
|
||||
next.css('opacity', '').removeClass(dir === -1 ? 'uk-slideshow-swipe-backward-in' : 'uk-slideshow-swipe-forward-in');
|
||||
d.resolve();
|
||||
|
||||
}.bind(this));
|
||||
|
||||
current.addClass(dir == 1 ? 'uk-slideshow-swipe-backward-out' : 'uk-slideshow-swipe-forward-out');
|
||||
next.addClass(dir == 1 ? 'uk-slideshow-swipe-backward-in' : 'uk-slideshow-swipe-forward-in');
|
||||
current.addClass(dir == -1 ? 'uk-slideshow-swipe-backward-out' : 'uk-slideshow-swipe-forward-out');
|
||||
next.addClass(dir == -1 ? 'uk-slideshow-swipe-backward-in' : 'uk-slideshow-swipe-forward-in');
|
||||
next.width(); // force redraw
|
||||
|
||||
return d.promise();
|
||||
@ -502,6 +511,14 @@
|
||||
|
||||
next.css('opacity', 1);
|
||||
|
||||
// for plain text content slides - looks smoother
|
||||
if (!(next.data('cover') || next.data('placeholder'))) {
|
||||
|
||||
next.css('opacity', 1).one(UI.support.animation.end, function() {
|
||||
next.removeClass('uk-slideshow-fade-in');
|
||||
}).addClass('uk-slideshow-fade-in');
|
||||
}
|
||||
|
||||
current.one(UI.support.animation.end, function() {
|
||||
|
||||
current.removeClass('uk-slideshow-fade-out');
|
||||
|
Reference in New Issue
Block a user