From 280fe969954bc57e2e5b9ef8ac15c2863c4e3060 Mon Sep 17 00:00:00 2001 From: David DeSandro Date: Thu, 12 May 2011 12:53:23 -0400 Subject: [PATCH] src : remove instance in _sort. Thx @sroucheray --- jquery.isotope.js | 2 +- jquery.isotope.min.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/jquery.isotope.js b/jquery.isotope.js index 77381ef..f92de4a 100644 --- a/jquery.isotope.js +++ b/jquery.isotope.js @@ -543,7 +543,7 @@ var a = getSorter( alpha, sortBy ), b = getSorter( beta, sortBy ); // fall back to original order if data matches - if ( a === b && instance.options.sortBy !== 'original-order') { + if ( a === b && sortBy !== 'original-order') { a = getSorter( alpha, 'original-order' ); b = getSorter( beta, 'original-order' ); } diff --git a/jquery.isotope.min.js b/jquery.isotope.min.js index ba84925..bd88693 100644 --- a/jquery.isotope.min.js +++ b/jquery.isotope.min.js @@ -19,7 +19,7 @@ this.options.itemSelector);a=this.element[0].style;this.originalStyle={};for(var this.options.transformsEnabled&&Modernizr.csstransforms&&Modernizr.csstransitions&&!a)?this._translate:this._positionAbs;this.options.getSortData=f.extend(this.options.getSortData,{"original-order":function(g,h){return h.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 e=this;setTimeout(function(){e.element.addClass(e.options.containerClass)},0); this.options.resizable&&f(k).bind("smartresize.isotope",function(){e.element.isotope("resize")})},_init:function(a){this.$filteredAtoms=this._filter(this.$allAtoms);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;a.each(function(){e=f(this); -g={};for(var h in d)g[h]=d[h](e,c);e.data("isotope-sort-data",g);b&&c.elemCount++})},_sort:function(){var a=this.options.sortBy,b=this._getSorter,c=this.options.sortAscending?1:-1;this.$filteredAtoms.sort(function(d,e){var g=b(d,a),h=b(e,a);if(g===h&&instance.options.sortBy!=="original-order"){g=b(d,"original-order");h=b(e,"original-order")}return(g>h?1:gh?1:g