vendor/assets/javascripts/uikit/components/slideshow-fx.js in uikit2-rails-0.1.9 vs vendor/assets/javascripts/uikit/components/slideshow-fx.js in uikit2-rails-0.1.10
- old
+ new
@@ -1,16 +1,16 @@
-/*! UIkit 2.26.3 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
+/*! UIkit 2.27.2 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
(function(addon) {
var component;
if (window.UIkit) {
component = addon(UIkit);
}
- if (typeof define == "function" && define.amd) {
- define("uikit-slideshow-fx", ["uikit"], function() {
+ if (typeof define == 'function' && define.amd) {
+ define('uikit-slideshow-fx', ['uikit'], function() {
return component || addon(UIkit);
});
}
})(function(UI) {
@@ -18,21 +18,21 @@
"use strict";
var Animations = UI.slideshow.animations;
UI.$.extend(UI.slideshow.animations, {
- 'slice': function(current, next, dir, fromfx) {
+ slice: function(current, next, dir, fromfx) {
if (!current.data('cover')) {
return Animations.fade.apply(this, arguments);
}
var d = UI.$.Deferred();
var sliceWidth = Math.ceil(this.element.width() / this.options.slices),
bgimage = next.data('cover').css('background-image'),
- ghost = UI.$('<li></li>').css({
+ ghost = UI.$('<li class="uk-slideshow-ghost"></li>').css({
top : 0,
left : 0,
width : this.container.width(),
height : this.container.height(),
opacity: 1,
@@ -78,23 +78,22 @@
}
this.container.append(ghost);
ghost.children().last().on(UI.support.transition.end, function() {
- ghost.remove();
- d.resolve();
+
+ setTimeout(function() {
+ ghost.remove();
+ d.resolve();
+ }, 0);
});
ghost.width();
ghost.children().each(function() {
- var bar = UI.$(this);
-
- bar.css({
- 'clip': bar.data('clip'),
- 'opacity': 1
- });
+ bar = UI.$(this);
+ bar.css({ clip: bar.data('clip'), opacity: 1 });
});
return d.promise();
},
@@ -108,21 +107,21 @@
'slice-up-down': function(current, next, dir) {
return Animations.slice.apply(this, [current, next, dir, 'slice-up-down']);
},
- 'fold': function(current, next, dir) {
+ fold: function(current, next, dir) {
if (!next.data('cover')) {
return Animations.fade.apply(this, arguments);
}
var d = UI.$.Deferred();
var sliceWidth = Math.ceil(this.element.width() / this.options.slices),
bgimage = next.data('cover').css('background-image'),
- ghost = UI.$('<li></li>').css({
+ ghost = UI.$('<li class="uk-slideshow-ghost"></li>').css({
width : next.width(),
height : next.height(),
opacity: 1,
zIndex : 15
}),
@@ -153,21 +152,23 @@
this.container.append(ghost);
ghost.width();
ghost.children().first().on(UI.support.transition.end, function() {
- ghost.remove();
- d.resolve();
+ setTimeout(function() {
+ ghost.remove();
+ d.resolve();
+ }, 0);
}).end().css({
- 'transform': 'scaleX(1)',
- 'opacity': 1
+ transform: 'scaleX(1)',
+ opacity: 1
});
return d.promise();
},
- 'puzzle': function(current, next, dir) {
+ puzzle: function(current, next, dir) {
if (!next.data('cover')) {
return Animations.fade.apply(this, arguments);
}
@@ -176,11 +177,11 @@
var boxCols = Math.round(this.options.slices/2),
boxWidth = Math.round(next.width()/boxCols),
boxRows = Math.round(next.height()/boxWidth),
boxHeight = Math.round(next.height()/boxRows)+1,
bgimage = next.data('cover').css('background-image'),
- ghost = UI.$('<li></li>').css({
+ ghost = UI.$('<li class="uk-slideshow-ghost"></li>').css({
width : this.container.width(),
height : this.container.height(),
opacity : 1,
zIndex : 15
}),
@@ -226,22 +227,25 @@
UI.$(this).css({
'transition': 'all '+$this.options.duration+'ms ease-in-out '+(50+i*25)+'ms',
'-webkit-transition': 'all '+$this.options.duration+'ms ease-in-out '+(50+i*25)+'ms'
});
}).last().on(UI.support.transition.end, function() {
- ghost.remove();
- d.resolve();
+
+ setTimeout(function() {
+ ghost.remove();
+ d.resolve();
+ }, 0);
});
ghost.width();
- boxes.css({'opacity': 1});
+ boxes.css({opacity: 1});
return d.promise();
},
- 'boxes': function(current, next, dir, fromfx) {
+ boxes: function(current, next, dir, fromfx) {
if (!next.data('cover')) {
return Animations.fade.apply(this, arguments);
}
@@ -250,11 +254,11 @@
var boxCols = Math.round(this.options.slices/2),
boxWidth = Math.round(next.width()/boxCols),
boxRows = Math.round(next.height()/boxWidth),
boxHeight = Math.round(next.height()/boxRows)+1,
bgimage = next.data('cover').css('background-image'),
- ghost = UI.$('<li></li>').css({
+ ghost = UI.$('<li class="uk-slideshow-ghost"></li>').css({
width : next.width(),
height : next.height(),
opacity : 1,
zIndex : 15
}),
@@ -330,11 +334,14 @@
}
timeBuff += 100;
}
boxes.last().on(UI.support.transition.end, function() {
- ghost.remove();
- d.resolve();
+
+ setTimeout(function() {
+ ghost.remove();
+ d.resolve();
+ }, 0);
});
ghost.width();
boxes.css({