From 377674a136cd4e52ac9067d93ef8a687983ac0a3 Mon Sep 17 00:00:00 2001 From: David DeSandro Date: Tue, 15 Oct 2013 07:00:41 -0400 Subject: [PATCH] check that sortHistory first item --- isotope.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/isotope.js b/isotope.js index 6d3856f..e1f0687 100644 --- a/isotope.js +++ b/isotope.js @@ -295,8 +295,7 @@ function isotopeDefinition( Outlayer, getSize, matchesSelector, Item, LayoutMode var itemSorter = getItemSorter( sortBys, this.options.sortAscending ); this.filteredItems.sort( itemSorter ); // keep track of sortBy History - var lastSortBy = this.sortHistory[ this.sortHistory.length - 1 ]; - if ( sortByOpt !== lastSortBy ) { + if ( sortByOpt !== this.sortHistory[0] ) { // add to front, oldest goes in last this.sortHistory.unshift( sortByOpt ); }