Permalink
Browse files

Gallery Build Tag: gallery-2011.05.18-19-11

  • Loading branch information...
1 parent 0f3ff5e commit 4d76a7f73f26d6e64be1ff653ced2cc59d57f27f YUI Builder committed May 18, 2011
@@ -117,7 +117,10 @@ Y.CarouselAnimPlugin = Y.extend(CarouselAnimPlugin, Y.Plugin.Base, {
CarouselAnimPlugin.NAME);
animation = self.get("animation");
if (carousel && animation.speed > 0) {
- index = carousel._getCorrectedIndex(index); // sanitize the value
+ index = carousel._getCorrectedIndex(index);
+ if (isNaN(index)) {
+ return;
+ }
cb = carousel.get("contentBox");
isVertical = carousel.get("isVertical");
if (isVertical) {
@@ -191,4 +194,4 @@ Y.CarouselAnimPlugin = Y.extend(CarouselAnimPlugin, Y.Plugin.Base, {
});
-}, 'gallery-2011.05.04-20-03' ,{requires:['gallery-carousel', 'anim', 'plugin', 'pluginhost']});
+}, 'gallery-2011.05.18-19-11' ,{requires:['gallery-carousel', 'anim', 'plugin', 'pluginhost']});
@@ -1 +1 @@
-YUI.add("gallery-carousel-anim",function(e){function a(){a.superclass.constructor.apply(this,arguments);}var d=e.Lang,c="afterScroll",b="beforeScroll";a.NAME="carouselAnimPlugin";a.NS="anim";a.ATTRS={animation:{validator:"_validateAnimation",value:{speed:0,effect:e.Easing.easeOut}}};e.CarouselAnimPlugin=e.extend(a,e.Plugin.Base,{initializer:function(f){this.beforeHostMethod("scrollTo",this.animateAndScrollTo);},animateAndScrollTo:function(j){var o=this,n=o.get("host"),g,h,f,i,m,k,l;if(n.get("rendered")){h=o.get("animation");if(n&&h.speed>0){j=n._getCorrectedIndex(j);f=n.get("contentBox");k=n.get("isVertical");if(k){m={top:n.get("top")};l={top:n._getOffsetForIndex(j)};}else{m={left:n.get("left")};l={left:n._getOffsetForIndex(j)};}i=n.getFirstVisible();o.fire(b,{first:i,last:i+n.get("numVisible")});g=new e.Anim({node:f,from:m,to:l,duration:h.speed,easing:h.effect});g.on("end",e.bind(o._afterAnimEnd,o,j));g.run();return new e.Do.Prevent();}}return false;},_afterAnimEnd:function(h){var f=this,g=f.get("host");g.set("selectedItem",h);},_validateAnimation:function(f){var g=false;if(d.isObject(f)){if(d.isNumber(f.speed)){g=true;}if(!d.isUndefined(f.effect)&&!d.isFunction(f.effect)){g=false;}}return g;},_animObj:null});},"gallery-2011.05.04-20-03",{requires:["gallery-carousel","anim","plugin","pluginhost"]});
+YUI.add("gallery-carousel-anim",function(e){function a(){a.superclass.constructor.apply(this,arguments);}var d=e.Lang,c="afterScroll",b="beforeScroll";a.NAME="carouselAnimPlugin";a.NS="anim";a.ATTRS={animation:{validator:"_validateAnimation",value:{speed:0,effect:e.Easing.easeOut}}};e.CarouselAnimPlugin=e.extend(a,e.Plugin.Base,{initializer:function(f){this.beforeHostMethod("scrollTo",this.animateAndScrollTo);},animateAndScrollTo:function(j){var o=this,n=o.get("host"),g,h,f,i,m,k,l;if(n.get("rendered")){h=o.get("animation");if(n&&h.speed>0){j=n._getCorrectedIndex(j);if(isNaN(j)){return;}f=n.get("contentBox");k=n.get("isVertical");if(k){m={top:n.get("top")};l={top:n._getOffsetForIndex(j)};}else{m={left:n.get("left")};l={left:n._getOffsetForIndex(j)};}i=n.getFirstVisible();o.fire(b,{first:i,last:i+n.get("numVisible")});g=new e.Anim({node:f,from:m,to:l,duration:h.speed,easing:h.effect});g.on("end",e.bind(o._afterAnimEnd,o,j));g.run();return new e.Do.Prevent();}}return false;},_afterAnimEnd:function(h){var f=this,g=f.get("host");g.set("selectedItem",h);},_validateAnimation:function(f){var g=false;if(d.isObject(f)){if(d.isNumber(f.speed)){g=true;}if(!d.isUndefined(f.effect)&&!d.isFunction(f.effect)){g=false;}}return g;},_animObj:null});},"gallery-2011.05.18-19-11",{requires:["gallery-carousel","anim","plugin","pluginhost"]});
@@ -115,7 +115,10 @@ Y.CarouselAnimPlugin = Y.extend(CarouselAnimPlugin, Y.Plugin.Base, {
if (carousel.get("rendered")) {
animation = self.get("animation");
if (carousel && animation.speed > 0) {
- index = carousel._getCorrectedIndex(index); // sanitize the value
+ index = carousel._getCorrectedIndex(index);
+ if (isNaN(index)) {
+ return;
+ }
cb = carousel.get("contentBox");
isVertical = carousel.get("isVertical");
if (isVertical) {
@@ -187,4 +190,4 @@ Y.CarouselAnimPlugin = Y.extend(CarouselAnimPlugin, Y.Plugin.Base, {
});
-}, 'gallery-2011.05.04-20-03' ,{requires:['gallery-carousel', 'anim', 'plugin', 'pluginhost']});
+}, 'gallery-2011.05.18-19-11' ,{requires:['gallery-carousel', 'anim', 'plugin', 'pluginhost']});
@@ -612,6 +612,9 @@ Y.Carousel = Y.extend(Carousel, Y.Widget, {
attr, cb, first, offset;
index = self._getCorrectedIndex(index); // sanitize the value
+ if (isNaN(index)) {
+ return;
+ }
offset = self._getOffsetForIndex(index);
cb = self.get("contentBox");
attr = self.get("isVertical") ? "top" : "left";
@@ -797,7 +800,7 @@ Y.Carousel = Y.extend(Carousel, Y.Widget, {
numItems = self.get("numItems"),
numVisible = self.get("numVisible"),
sentinel = numItems - 1,
- firstOfLastPage;
+ firstOfLastPage = 0;
// Fix for Issues #2 and #11 - thanks <http://github.com/amasad>
if (isCircular) {
@@ -1464,4 +1467,4 @@ Y.Carousel = Y.extend(Carousel, Y.Widget, {
});
-}, 'gallery-2011.05.04-20-03' ,{skinnable:true, requires:['widget']});
+}, 'gallery-2011.05.18-19-11' ,{skinnable:true, requires:['widget']});
Oops, something went wrong.

0 comments on commit 4d76a7f

Please sign in to comment.