vendor/assets/javascripts/uikit/components/slideshow.js in uikit2-rails-0.1.2 vs vendor/assets/javascripts/uikit/components/slideshow.js in uikit2-rails-0.1.3
- old
+ new
@@ -1,6 +1,6 @@
-/*! UIkit 2.23.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
+/*! UIkit 2.24.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
(function(addon) {
var component;
if (window.UIkit) {
@@ -303,11 +303,11 @@
$this.animating = false;
$this.current = index;
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);
// animation fallback
@@ -316,10 +316,12 @@
}
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');
$this.triggers.filter('[data-uk-slideshow-item="'+index+'"]').addClass('uk-active');
},
@@ -499,9 +501,17 @@
current.css('animation-duration', this.options.duration+'ms');
next.css('animation-duration', this.options.duration+'ms');
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');
next.css('opacity', '');