From c34c5cb5007bc44cfb382f2b48469a5e3c52e9c4 Mon Sep 17 00:00:00 2001 From: David DeSandro Date: Wed, 8 Mar 2017 20:06:52 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20build=20v3.0.3;=20=F0=9F=93=85?= =?UTF-8?q?=202017?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- dist/isotope.pkgd.js | 43 ++++++++++++++++++++++++---------------- dist/isotope.pkgd.min.js | 8 ++++---- js/isotope.js | 4 ++-- package.json | 2 +- 5 files changed, 34 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index de3148a..c175b46 100644 --- a/README.md +++ b/README.md @@ -82,4 +82,4 @@ Add a `data-isotope` attribute to your element. Options can be set in JSON in th * * * -By [Metafizzy](http://metafizzy.co), 2010–2016 +By [Metafizzy](http://metafizzy.co), 2010–2017 diff --git a/dist/isotope.pkgd.js b/dist/isotope.pkgd.js index 9027b1e..67b38ac 100644 --- a/dist/isotope.pkgd.js +++ b/dist/isotope.pkgd.js @@ -1,11 +1,11 @@ /*! - * Isotope PACKAGED v3.0.2 + * Isotope PACKAGED v3.0.3 * * Licensed GPLv3 for open source use * or Isotope Commercial License for commercial use * * http://isotope.metafizzy.co - * Copyright 2016 Metafizzy + * Copyright 2017 Metafizzy */ /** @@ -473,7 +473,7 @@ return getSize; }); /** - * matchesSelector v2.0.1 + * matchesSelector v2.0.2 * matchesSelector( element, '.selector' ) * MIT license */ @@ -499,7 +499,7 @@ return getSize; 'use strict'; var matchesMethod = ( function() { - var ElemProto = Element.prototype; + var ElemProto = window.Element.prototype; // check for the standard method name first if ( ElemProto.matches ) { return 'matches'; @@ -527,7 +527,7 @@ return getSize; })); /** - * Fizzy UI utils v2.0.3 + * Fizzy UI utils v2.0.4 * MIT license */ @@ -588,7 +588,8 @@ utils.makeArray = function( obj ) { if ( Array.isArray( obj ) ) { // use object if already an array ary = obj; - } else if ( obj && typeof obj.length == 'number' ) { + } else if ( obj && typeof obj == 'object' && + typeof obj.length == 'number' ) { // convert nodeList to array for ( var i=0; i < obj.length; i++ ) { ary.push( obj[i] ); @@ -2900,13 +2901,13 @@ return Vertical; })); /*! - * Isotope v3.0.2 + * Isotope v3.0.3 * * Licensed GPLv3 for open source use * or Isotope Commercial License for commercial use * * http://isotope.metafizzy.co - * Copyright 2016 Metafizzy + * Copyright 2017 Metafizzy */ ( function( window, factory ) { @@ -3303,20 +3304,28 @@ var trim = String.prototype.trim ? // sort filteredItem order proto._sort = function() { - var sortByOpt = this.options.sortBy; - if ( !sortByOpt ) { + if ( !this.options.sortBy ) { return; } - // concat all sortBy and sortHistory - var sortBys = [].concat.apply( sortByOpt, this.sortHistory ); + // keep track of sortBy History + var sortBys = utils.makeArray( this.options.sortBy ); + if ( !this._getIsSameSortBy( sortBys ) ) { + // concat all sortBy and sortHistory, add to front, oldest goes in last + this.sortHistory = sortBys.concat( this.sortHistory ); + } // sort magic - var itemSorter = getItemSorter( sortBys, this.options.sortAscending ); + var itemSorter = getItemSorter( this.sortHistory, this.options.sortAscending ); this.filteredItems.sort( itemSorter ); - // keep track of sortBy History - if ( sortByOpt != this.sortHistory[0] ) { - // add to front, oldest goes in last - this.sortHistory.unshift( sortByOpt ); + }; + + // check if sortBys is same as start of sortHistory + proto._getIsSameSortBy = function( sortBys ) { + for ( var i=0; i < sortBys.length; i++ ) { + if ( sortBys[i] != this.sortHistory[i] ) { + return false; + } } + return true; }; // returns a function used for sorting diff --git a/dist/isotope.pkgd.min.js b/dist/isotope.pkgd.min.js index 8c2f57b..c417bc7 100644 --- a/dist/isotope.pkgd.min.js +++ b/dist/isotope.pkgd.min.js @@ -1,12 +1,12 @@ /*! - * Isotope PACKAGED v3.0.2 + * Isotope PACKAGED v3.0.3 * * Licensed GPLv3 for open source use * or Isotope Commercial License for commercial use * * http://isotope.metafizzy.co - * Copyright 2016 Metafizzy + * Copyright 2017 Metafizzy */ -!function(t,e){"function"==typeof define&&define.amd?define("jquery-bridget/jquery-bridget",["jquery"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("jquery")):t.jQueryBridget=e(t,t.jQuery)}(window,function(t,e){"use strict";function i(i,s,a){function u(t,e,n){var o,s="$()."+i+'("'+e+'")';return t.each(function(t,u){var h=a.data(u,i);if(!h)return void r(i+" not initialized. Cannot call methods, i.e. "+s);var d=h[e];if(!d||"_"==e.charAt(0))return void r(s+" is not a valid method");var l=d.apply(h,n);o=void 0===o?l:o}),void 0!==o?o:t}function h(t,e){t.each(function(t,n){var o=a.data(n,i);o?(o.option(e),o._init()):(o=new s(n,e),a.data(n,i,o))})}a=a||e||t.jQuery,a&&(s.prototype.option||(s.prototype.option=function(t){a.isPlainObject(t)&&(this.options=a.extend(!0,this.options,t))}),a.fn[i]=function(t){if("string"==typeof t){var e=o.call(arguments,1);return u(this,t,e)}return h(this,t),this},n(a))}function n(t){!t||t&&t.bridget||(t.bridget=i)}var o=Array.prototype.slice,s=t.console,r="undefined"==typeof s?function(){}:function(t){s.error(t)};return n(e||t.jQuery),i}),function(t,e){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",e):"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}("undefined"!=typeof window?window:this,function(){function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var i=this._events=this._events||{},n=i[t]=i[t]||[];return n.indexOf(e)==-1&&n.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var i=this._onceEvents=this._onceEvents||{},n=i[t]=i[t]||{};return n[e]=!0,this}},e.off=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=i.indexOf(e);return n!=-1&&i.splice(n,1),this}},e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=0,o=i[n];e=e||[];for(var s=this._onceEvents&&this._onceEvents[t];o;){var r=s&&s[o];r&&(this.off(t,o),delete s[o]),o.apply(this,e),n+=r?0:1,o=i[n]}return this}},t}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("get-size/get-size",[],function(){return e()}):"object"==typeof module&&module.exports?module.exports=e():t.getSize=e()}(window,function(){"use strict";function t(t){var e=parseFloat(t),i=t.indexOf("%")==-1&&!isNaN(e);return i&&e}function e(){}function i(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},e=0;e