Skip to content

Commit c34c5cb

Browse files
committed
πŸ‘· build v3.0.3; πŸ“… 2017
1 parent 887570e commit c34c5cb

File tree

5 files changed

+34
-25
lines changed

5 files changed

+34
-25
lines changed

β€ŽREADME.mdβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,4 @@ Add a `data-isotope` attribute to your element. Options can be set in JSON in th
8282

8383
* * *
8484

85-
By [Metafizzy](http://metafizzy.co), 2010–2016
85+
By [Metafizzy](http://metafizzy.co), 2010–2017

β€Ždist/isotope.pkgd.jsβ€Ž

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/*!
2-
* Isotope PACKAGED v3.0.2
2+
* Isotope PACKAGED v3.0.3
33
*
44
* Licensed GPLv3 for open source use
55
* or Isotope Commercial License for commercial use
66
*
77
* http://isotope.metafizzy.co
8-
* Copyright 2016 Metafizzy
8+
* Copyright 2017 Metafizzy
99
*/
1010

1111
/**
@@ -473,7 +473,7 @@ return getSize;
473473
});
474474

475475
/**
476-
* matchesSelector v2.0.1
476+
* matchesSelector v2.0.2
477477
* matchesSelector( element, '.selector' )
478478
* MIT license
479479
*/
@@ -499,7 +499,7 @@ return getSize;
499499
'use strict';
500500

501501
var matchesMethod = ( function() {
502-
var ElemProto = Element.prototype;
502+
var ElemProto = window.Element.prototype;
503503
// check for the standard method name first
504504
if ( ElemProto.matches ) {
505505
return 'matches';
@@ -527,7 +527,7 @@ return getSize;
527527
}));
528528

529529
/**
530-
* Fizzy UI utils v2.0.3
530+
* Fizzy UI utils v2.0.4
531531
* MIT license
532532
*/
533533

@@ -588,7 +588,8 @@ utils.makeArray = function( obj ) {
588588
if ( Array.isArray( obj ) ) {
589589
// use object if already an array
590590
ary = obj;
591-
} else if ( obj && typeof obj.length == 'number' ) {
591+
} else if ( obj && typeof obj == 'object' &&
592+
typeof obj.length == 'number' ) {
592593
// convert nodeList to array
593594
for ( var i=0; i < obj.length; i++ ) {
594595
ary.push( obj[i] );
@@ -2900,13 +2901,13 @@ return Vertical;
29002901
}));
29012902

29022903
/*!
2903-
* Isotope v3.0.2
2904+
* Isotope v3.0.3
29042905
*
29052906
* Licensed GPLv3 for open source use
29062907
* or Isotope Commercial License for commercial use
29072908
*
29082909
* http://isotope.metafizzy.co
2909-
* Copyright 2016 Metafizzy
2910+
* Copyright 2017 Metafizzy
29102911
*/
29112912

29122913
( function( window, factory ) {
@@ -3303,20 +3304,28 @@ var trim = String.prototype.trim ?
33033304

33043305
// sort filteredItem order
33053306
proto._sort = function() {
3306-
var sortByOpt = this.options.sortBy;
3307-
if ( !sortByOpt ) {
3307+
if ( !this.options.sortBy ) {
33083308
return;
33093309
}
3310-
// concat all sortBy and sortHistory
3311-
var sortBys = [].concat.apply( sortByOpt, this.sortHistory );
3310+
// keep track of sortBy History
3311+
var sortBys = utils.makeArray( this.options.sortBy );
3312+
if ( !this._getIsSameSortBy( sortBys ) ) {
3313+
// concat all sortBy and sortHistory, add to front, oldest goes in last
3314+
this.sortHistory = sortBys.concat( this.sortHistory );
3315+
}
33123316
// sort magic
3313-
var itemSorter = getItemSorter( sortBys, this.options.sortAscending );
3317+
var itemSorter = getItemSorter( this.sortHistory, this.options.sortAscending );
33143318
this.filteredItems.sort( itemSorter );
3315-
// keep track of sortBy History
3316-
if ( sortByOpt != this.sortHistory[0] ) {
3317-
// add to front, oldest goes in last
3318-
this.sortHistory.unshift( sortByOpt );
3319+
};
3320+
3321+
// check if sortBys is same as start of sortHistory
3322+
proto._getIsSameSortBy = function( sortBys ) {
3323+
for ( var i=0; i < sortBys.length; i++ ) {
3324+
if ( sortBys[i] != this.sortHistory[i] ) {
3325+
return false;
3326+
}
33193327
}
3328+
return true;
33203329
};
33213330

33223331
// returns a function used for sorting

β€Ždist/isotope.pkgd.min.jsβ€Ž

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Žjs/isotope.jsβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/*!
2-
* Isotope v3.0.2
2+
* Isotope v3.0.3
33
*
44
* Licensed GPLv3 for open source use
55
* or Isotope Commercial License for commercial use
66
*
77
* http://isotope.metafizzy.co
8-
* Copyright 2016 Metafizzy
8+
* Copyright 2017 Metafizzy
99
*/
1010

1111
( function( window, factory ) {

β€Žpackage.jsonβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "isotope-layout",
3-
"version": "3.0.2",
3+
"version": "3.0.3",
44
"description": "Filter and sort magical layouts",
55
"main": "js/isotope.js",
66
"dependencies": {

0 commit comments

Comments
Β (0)