vendor/assets/javascripts/uikit/components/slideset.js in uikit2-rails-0.1.5 vs vendor/assets/javascripts/uikit/components/slideset.js in uikit2-rails-0.1.6

- old
+ new

@@ -1,6 +1,6 @@ -/*! UIkit 2.24.3 | 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; if (window.UIkit) { @@ -73,11 +73,11 @@ } $this.list.addClass('uk-grid-width-'+bp+'-1-'+$this.options[bp]); }); - this.on("click.uikit.slideset", '[data-uk-slideset-item]', function(e) { + this.on("click.uk.slideset", '[data-uk-slideset-item]', function(e) { e.preventDefault(); if ($this.animating) { return; @@ -96,11 +96,11 @@ $this.show(parseInt(set, 10)); } }); - this.controls.on('click.uikit.slideset', '[data-uk-filter]', function(e) { + this.controls.on('click.uk.slideset', '[data-uk-filter]', function(e) { var ele = UI.$(this); if (ele.parent().hasClass('uk-slideset')) { return; @@ -430,16 +430,24 @@ for (i=0;i<next.length;i++) { next.eq(dir == 1 ? i:(next.length - i)-1).css('animation-delay', (i*delay)+'ms'); } - next.addClass(clsIn)[dir==1 ? 'last':'first']().one(UI.support.animation.end, function() { - + var finish = function() { next.removeClass(''+clsIn+'').css({opacity:'', display:'', 'animation-delay':'', 'animation':''}); d.resolve(); $this.element.css('min-height', ''); + finish = false; + }; + next.addClass(clsIn)[dir==1 ? 'last':'first']().one(UI.support.animation.end, function(){ + if(finish) finish(); }).end().css('display', ''); + + // make sure everything resolves really + setTimeout(function() { + if(finish) finish(); + }, next.length * delay * 2); }; if (next.length) { next.css('animation-duration', this.options.duration+'ms'); }