From ad008079ec0bc6387d2781b98cfd5c80a9fc0b40 Mon Sep 17 00:00:00 2001 From: David DeSandro Date: Fri, 6 Apr 2018 12:13:55 -0400 Subject: [PATCH] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20outlayer=20v2.1.1.=20#916;?= =?UTF-8?q?=20=F0=9F=91=B7=E2=80=8D=E2=99=80=EF=B8=8F=20v3.0.6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ⬆️ get-size 2.0.3, fizzy-ui-utils 2.0.7 --- README.md | 2 +- bower.json | 4 +- dist/isotope.pkgd.js | 92 ++++++++++++++++++++-------------------- dist/isotope.pkgd.min.js | 8 ++-- js/isotope.js | 4 +- package.json | 2 +- 6 files changed, 57 insertions(+), 55 deletions(-) diff --git a/README.md b/README.md index 2ba23b2..1aa6088 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](https://metafizzy.co), 2010–2017 +By [Metafizzy 🌈🐻](https://metafizzy.co), 2010–2018 diff --git a/bower.json b/bower.json index 69e4571..5653c32 100644 --- a/bower.json +++ b/bower.json @@ -10,9 +10,9 @@ "outlayer": "^2.1.0" }, "devDependencies": { - "jquery": "2 < 4", + "jquery": "^3.3.1", "jquery-bridget": "^2", - "qunit": "^1.15" + "qunit": "^2.6.0" }, "ignore": [ "test/", diff --git a/dist/isotope.pkgd.js b/dist/isotope.pkgd.js index f409085..fde0071 100644 --- a/dist/isotope.pkgd.js +++ b/dist/isotope.pkgd.js @@ -1,11 +1,11 @@ /*! - * Isotope PACKAGED v3.0.5 + * Isotope PACKAGED v3.0.6 * * Licensed GPLv3 for open source use * or Isotope Commercial License for commercial use * * https://isotope.metafizzy.co - * Copyright 2017 Metafizzy + * Copyright 2010-2018 Metafizzy */ /** @@ -266,22 +266,19 @@ return EvEmitter; })); /*! - * getSize v2.0.2 + * getSize v2.0.3 * measure size of elements * MIT license */ -/*jshint browser: true, strict: true, undef: true, unused: true */ -/*global define: false, module: false, console: false */ +/* jshint browser: true, strict: true, undef: true, unused: true */ +/* globals console: false */ ( function( window, factory ) { - 'use strict'; - + /* jshint strict: false */ /* globals define, module */ if ( typeof define == 'function' && define.amd ) { // AMD - define( 'get-size/get-size',[],function() { - return factory(); - }); + define( 'get-size/get-size',factory ); } else if ( typeof module == 'object' && module.exports ) { // CommonJS module.exports = factory(); @@ -356,7 +353,7 @@ function getStyle( elem ) { if ( !style ) { logError( 'Style returned ' + style + '. Are you running this code in a hidden iframe on Firefox? ' + - 'See http://bit.ly/getsizebug1' ); + 'See https://bit.ly/getsizebug1' ); } return style; } @@ -382,8 +379,8 @@ function setup() { // -------------------------- box sizing -------------------------- // /** - * WebKit measures the outer-width on style.width on border-box elems - * IE & Firefox<29 measures the inner-width + * Chrome & Safari measure the outer-width on style.width on border-box elems + * IE11 & Firefox<29 measures the inner-width */ var div = document.createElement('div'); div.style.width = '200px'; @@ -395,10 +392,11 @@ function setup() { var body = document.body || document.documentElement; body.appendChild( div ); var style = getStyle( div ); + // round value for browser zoom. desandro/masonry#928 + isBoxSizeOuter = Math.round( getStyleSize( style.width ) ) == 200; + getSize.isBoxSizeOuter = isBoxSizeOuter; - getSize.isBoxSizeOuter = isBoxSizeOuter = getStyleSize( style.width ) == 200; body.removeChild( div ); - } // -------------------------- getSize -------------------------- // @@ -530,7 +528,7 @@ return getSize; })); /** - * Fizzy UI utils v2.0.5 + * Fizzy UI utils v2.0.7 * MIT license */ @@ -585,23 +583,27 @@ utils.modulo = function( num, div ) { // ----- makeArray ----- // +var arraySlice = Array.prototype.slice; + // turn element or nodeList into an array utils.makeArray = function( obj ) { - var ary = []; if ( Array.isArray( obj ) ) { // use object if already an array - ary = obj; - } else if ( obj && typeof obj == 'object' && - typeof obj.length == 'number' ) { + return obj; + } + // return empty array if undefined or null. #6 + if ( obj === null || obj === undefined ) { + return []; + } + + var isArrayLike = typeof obj == 'object' && typeof obj.length == 'number'; + if ( isArrayLike ) { // convert nodeList to array - for ( var i=0; i < obj.length; i++ ) { - ary.push( obj[i] ); - } - } else { - // array of single index - ary.push( obj ); + return arraySlice.call( obj ); } - return ary; + + // array of single index + return [ obj ]; }; // ----- removeFrom ----- // @@ -680,22 +682,21 @@ utils.filterFindElements = function( elems, selector ) { // ----- debounceMethod ----- // utils.debounceMethod = function( _class, methodName, threshold ) { + threshold = threshold || 100; // original method var method = _class.prototype[ methodName ]; var timeoutName = methodName + 'Timeout'; _class.prototype[ methodName ] = function() { var timeout = this[ timeoutName ]; - if ( timeout ) { - clearTimeout( timeout ); - } - var args = arguments; + clearTimeout( timeout ); + var args = arguments; var _this = this; this[ timeoutName ] = setTimeout( function() { method.apply( _this, args ); delete _this[ timeoutName ]; - }, threshold || 100 ); + }, threshold ); }; }; @@ -903,13 +904,16 @@ proto.getPosition = function() { var isOriginTop = this.layout._getOption('originTop'); var xValue = style[ isOriginLeft ? 'left' : 'right' ]; var yValue = style[ isOriginTop ? 'top' : 'bottom' ]; + var x = parseFloat( xValue ); + var y = parseFloat( yValue ); // convert percent to pixels var layoutSize = this.layout.size; - var x = xValue.indexOf('%') != -1 ? - ( parseFloat( xValue ) / 100 ) * layoutSize.width : parseInt( xValue, 10 ); - var y = yValue.indexOf('%') != -1 ? - ( parseFloat( yValue ) / 100 ) * layoutSize.height : parseInt( yValue, 10 ); - + if ( xValue.indexOf('%') != -1 ) { + x = ( x / 100 ) * layoutSize.width; + } + if ( yValue.indexOf('%') != -1 ) { + y = ( y / 100 ) * layoutSize.height; + } // clean up 'auto' or other non-integer values x = isNaN( x ) ? 0 : x; y = isNaN( y ) ? 0 : y; @@ -972,9 +976,7 @@ proto._transitionTo = function( x, y ) { var curX = this.position.x; var curY = this.position.y; - var compareX = parseInt( x, 10 ); - var compareY = parseInt( y, 10 ); - var didNotMove = compareX === this.position.x && compareY === this.position.y; + var didNotMove = x == this.position.x && y == this.position.y; // save end position this.setPosition( x, y ); @@ -1017,8 +1019,8 @@ proto.goTo = function( x, y ) { proto.moveTo = proto._transitionTo; proto.setPosition = function( x, y ) { - this.position.x = parseInt( x, 10 ); - this.position.y = parseInt( y, 10 ); + this.position.x = parseFloat( x ); + this.position.y = parseFloat( y ); }; // ----- transition ----- // @@ -1323,7 +1325,7 @@ return Item; })); /*! - * Outlayer v2.1.0 + * Outlayer v2.1.1 * the brains and guts of a layout library * MIT license */ @@ -2938,13 +2940,13 @@ return Vertical; })); /*! - * Isotope v3.0.5 + * Isotope v3.0.6 * * Licensed GPLv3 for open source use * or Isotope Commercial License for commercial use * * https://isotope.metafizzy.co - * Copyright 2017 Metafizzy + * Copyright 2010-2018 Metafizzy */ ( function( window, factory ) { diff --git a/dist/isotope.pkgd.min.js b/dist/isotope.pkgd.min.js index f6361b9..7ca671c 100644 --- a/dist/isotope.pkgd.min.js +++ b/dist/isotope.pkgd.min.js @@ -1,12 +1,12 @@ /*! - * Isotope PACKAGED v3.0.5 + * Isotope PACKAGED v3.0.6 * * Licensed GPLv3 for open source use * or Isotope Commercial License for commercial use * * https://isotope.metafizzy.co - * Copyright 2017 Metafizzy + * Copyright 2010-2018 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,o){var n,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,o);n=void 0===n?l:n}),void 0!==n?n:t}function h(t,e){t.each(function(t,o){var n=a.data(o,i);n?(n.option(e),n._init()):(n=new s(o,e),a.data(o,i,n))})}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=n.call(arguments,1);return u(this,t,e)}return h(this,t),this},o(a))}function o(t){!t||t&&t.bridget||(t.bridget=i)}var n=Array.prototype.slice,s=t.console,r="undefined"==typeof s?function(){}:function(t){s.error(t)};return o(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||{},o=i[t]=i[t]||[];return o.indexOf(e)==-1&&o.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var i=this._onceEvents=this._onceEvents||{},o=i[t]=i[t]||{};return o[e]=!0,this}},e.off=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var o=i.indexOf(e);return o!=-1&&i.splice(o,1),this}},e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){i=i.slice(0),e=e||[];for(var o=this._onceEvents&&this._onceEvents[t],n=0;n