diff --git a/jquery.isotope.js b/jquery.isotope.js index e23445d..ea28bde 100644 --- a/jquery.isotope.js +++ b/jquery.isotope.js @@ -1,5 +1,5 @@ /** - * Isotope v1.0.110214 + * Isotope v1.0.110220 * An exquisite jQuery plugin for magical layouts * http://isotope.metafizzy.co * @@ -388,8 +388,7 @@ this.applyStyleFnName = 'animate'; jQueryAnimation = true; break; - case 'bestavailable' : - default : + default : // best available this.applyStyleFnName = Modernizr.csstransitions ? 'css' : 'animate'; } @@ -539,12 +538,12 @@ updateSortData : function( $atoms, isIncrementingElemCount ) { var instance = this, getSortData = this.options.getSortData, - key, $this, sortData; + $this, sortData; $atoms.each(function(){ $this = $(this); sortData = {}; // get value for sort data based on fn( $elem ) passed in - for ( key in getSortData ) { + for ( var key in getSortData ) { sortData[ key ] = getSortData[ key ]( $this, instance ); } // apply sort data to $element @@ -562,7 +561,7 @@ getSorter = function( elem ) { return $(elem).data('isotope-sort-data')[ instance.options.sortBy ]; }, - sortDir = this.options.sortAscending ? 1 : -1; + sortDir = this.options.sortAscending ? 1 : -1, sortFn = function( alpha, beta ) { var a = getSorter( alpha ), b = getSorter( beta ); @@ -671,7 +670,7 @@ var instance = this; this.addItems( $content, function( $newAtoms ) { - $filteredAtoms = instance._filter( $newAtoms ); + var $filteredAtoms = instance._filter( $newAtoms ); instance.$filteredAtoms = instance.$filteredAtoms.add( $filteredAtoms ); }); diff --git a/jquery.isotope.min.js b/jquery.isotope.min.js index 65a01a6..fdde3fd 100644 --- a/jquery.isotope.min.js +++ b/jquery.isotope.min.js @@ -1,5 +1,5 @@ /** - * Isotope v1.0.110214 + * Isotope v1.0.110220 * An exquisite jQuery plugin for magical layouts * http://isotope.metafizzy.co * @@ -19,13 +19,13 @@ this.options.itemSelector);this.element.css({overflow:"hidden",position:"relativ {"original-order":function(c,d){return d.elemCount}});this._setupAtoms(this.$allAtoms);a=f(document.createElement("div"));this.element.prepend(a);this.posTop=Math.round(a.position().top);this.posLeft=Math.round(a.position().left);a.remove();var b=this;setTimeout(function(){b.element.addClass(b.options.containerClass)},0);this.options.resizable&&f(l).bind("smartresize.isotope",function(){b.element.isotope("resize")})},_isNewProp:function(a){return this.prevOpts?this.options[a]!==this.prevOpts[a]:true}, _init:function(a){var b=this;f.each(["filter","sortBy","sortAscending"],function(c,d){b.isNew[d]=b._isNewProp(d)});this.$filteredAtoms=this.isNew.filter?this._filter(this.$allAtoms):this.$allAtoms;if(this.isNew.filter||this.isNew.sortBy||this.isNew.sortAscending)this._sort();this.reLayout(a)},option:function(a,b){if(f.isPlainObject(a))this.options=f.extend(true,this.options,a);else if(a&&typeof b==="undefined")return this.options[a];else this.options[a]=b;return this},_setupAtoms:function(a){var b= {position:"absolute"};if(this.usingTransforms){b.left=0;b.top=0}a.css(b).addClass(this.options.itemClass);this.updateSortData(a,true)},_filter:function(a){var b=this.options.filter===""?"*":this.options.filter;if(b){var c=this.options.hiddenClass,d="."+c,e=a.not(d),g=a.filter(d);d=g;a=a.filter(b);if(b!=="*"){d=g.filter(b);b=e.not(b).toggleClass(c);b.addClass(c);this.styleQueue.push({$el:b,style:this.options.hiddenStyle})}this.styleQueue.push({$el:d,style:this.options.visibleStyle});d.removeClass(c)}return a}, -updateSortData:function(a,b){var c=this,d=this.options.getSortData,e,g,h;a.each(function(){g=f(this);h={};for(e in d)h[e]=d[e](g,c);g.data("isotope-sort-data",h);b&&c.elemCount++})},_sort:function(){var a=this,b=function(d){return f(d).data("isotope-sort-data")[a.options.sortBy]},c=this.options.sortAscending?1:-1;sortFn=function(d,e){var g=b(d),h=b(e);return(g>h?1:gh?1:gb.width){b.fitRows.x=0;b.fitRows.y=b.fitRows.height}b._pushPosition(c,b.fitRows.x+b.posLeft,b.fitRows.y+b.posTop);b.fitRows.height=Math.max(b.fitRows.y+e,b.fitRows.height);b.fitRows.x+=d})},_fitRowsReset:function(){this.fitRows={x:0,y:0,height:0};return this},_fitRowsGetContainerSize:function(){return{height:this.fitRows.height}},_fitRowsResize:function(){return this.reLayout()},_cellsByRowReset:function(){this.cellsByRow= {};this._getSegments("cellsByRow");this.cellsByRow.rowHeight=this.options.cellsByRow.rowHeight||this.$allAtoms.outerHeight(true);return this},_cellsByRowLayout:function(a){var b=this,c=this.cellsByRow.cols;this.cellsByRow.atomsLen=a.length;a.each(function(d){var e=f(this),g=(d%c+0.5)*b.cellsByRow.columnWidth-e.outerWidth(true)/2+b.posLeft;d=(~~(d/c)+0.5)*b.cellsByRow.rowHeight-e.outerHeight(true)/2+b.posTop;b._pushPosition(e,g,d)});return this},_cellsByRowGetContainerSize:function(){return{height:Math.ceil(this.cellsByRow.atomsLen/