From 4d10ee57a96ed7c15046b591fb3aa2d500db3e30 Mon Sep 17 00:00:00 2001 From: David DeSandro Date: Thu, 31 Oct 2013 07:33:47 -0400 Subject: [PATCH] .magic -> .arrange --- js/isotope.js | 8 ++++---- notes.md | 2 +- test/filtering.js | 6 +++--- test/layout-complete.js | 10 +++++----- test/sorting.js | 6 +++--- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/js/isotope.js b/js/isotope.js index ca1fc8b..c3eea42 100644 --- a/js/isotope.js +++ b/js/isotope.js @@ -107,7 +107,7 @@ function isotopeDefinition( Outlayer, getSize, matchesSelector, Item, LayoutMode Isotope.prototype.layout = function() { // if first time doing layout, do all magic if ( !this._isLayoutInited && this.options.isInitLayout ) { - this.magic(); + this.arrange(); return; } this._layout(); @@ -127,7 +127,7 @@ function isotopeDefinition( Outlayer, getSize, matchesSelector, Item, LayoutMode }; // filter + sort + layout - Isotope.prototype.magic = function( opts ) { + Isotope.prototype.arrange = function( opts ) { // set any options pass this.option( opts ); this._getIsInstant(); @@ -136,8 +136,8 @@ function isotopeDefinition( Outlayer, getSize, matchesSelector, Item, LayoutMode this._sort(); this._layout(); }; - // alias - Isotope.prototype.filterSortLayout = Isotope.prototype.magic; + // alias to _init for main plugin method + Isotope.prototype._init = Isotope.prototype.arrange; // HACK // Don't animate/transition first layout diff --git a/notes.md b/notes.md index b69ed3c..a94ac99 100644 --- a/notes.md +++ b/notes.md @@ -47,7 +47,7 @@ iso.display({}) Orrrrrr keep .layout() and have reLayout() ---- +## Isotope vs Masonry vs Packery Masonry Isotope Packery Masonry Layouts x x x diff --git a/test/filtering.js b/test/filtering.js index 0884ac9..68187ab 100644 --- a/test/filtering.js +++ b/test/filtering.js @@ -35,7 +35,7 @@ test( 'filtering', function() { equal( ids, '1,2,3,4,5,6,7', 'all items there by default' ); function checkFilter( filter, expectedIDs, message ) { - iso.magic({ filter: filter }); + iso.arrange({ filter: filter }); ids = getFilteredItemIDs( iso ); equal( ids, expectedIDs, message || filter ); } @@ -44,7 +44,7 @@ test( 'filtering', function() { checkFilter( '.tall', '3,4,7' ); checkFilter( '.tall.orange', '3,7' ); - iso.magic({ + iso.arrange({ filter: function( elem ) { var num = parseInt( getText( elem ), 10 ); return num > 5; @@ -63,7 +63,7 @@ test( 'filtering', function() { checkFilter( ':not(.orange)', '2,4,5' ); checkFilter( '.orange:not(.tall)', '1,6' ); - iso.magic({ + iso.arrange({ filter: function() { var num = parseInt( $(this).text(), 10 ); return num > 5; diff --git a/test/layout-complete.js b/test/layout-complete.js index caf1861..82a1ec4 100644 --- a/test/layout-complete.js +++ b/test/layout-complete.js @@ -14,7 +14,7 @@ test( 'layoutComplete', function() { next(); }); - iso.magic({ + iso.arrange({ filter: '.a1' }); }, @@ -24,7 +24,7 @@ test( 'layoutComplete', function() { next(); }); - iso.magic({ + iso.arrange({ filter: '.b2' }); }, @@ -34,7 +34,7 @@ test( 'layoutComplete', function() { next(); }); - iso.magic({ + iso.arrange({ sortBy: 'random' }); }, @@ -44,13 +44,13 @@ test( 'layoutComplete', function() { next(); }); - iso.magic({ + iso.arrange({ filter: '.a2', transitionDuration: '0.6s' }); setTimeout( function() { - iso.magic({ + iso.arrange({ filter: '.b2' }); }, 300 ); diff --git a/test/sorting.js b/test/sorting.js index 9f5f3b4..6c0dacf 100644 --- a/test/sorting.js +++ b/test/sorting.js @@ -25,7 +25,7 @@ test( 'sorting', function() { sortBy: 'number' }); - iso.magic({ sortBy: 'letter' }); + iso.arrange({ sortBy: 'letter' }); var texts = getItemsText( iso ); @@ -48,12 +48,12 @@ test( 'sorting', function() { equal( getItemsText( iso ), 'A1,A2,A3,A4,B1,B2,B4', 'sortBy array' ); - iso.magic({ + iso.arrange({ sortAscending: false }); equal( getItemsText( iso ), 'B4,B2,B1,A4,A3,A2,A1', 'sortAscending false' ); - iso.magic({ + iso.arrange({ sortAscending: { letter: true, number: false