Skip to content

Commit

Permalink
build v3.2.3
Browse files Browse the repository at this point in the history
2015 copyright
  • Loading branch information
desandro committed Apr 1, 2015
1 parent fbf7d0d commit c5c64b7
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 45 deletions.
2 changes: 1 addition & 1 deletion README.mdown
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ Masonry is released under the [MIT license](http://desandro.mit-license.org). Ha

* * *

Copyright :copyright: 2014 David DeSandro
Copyright :copyright: 2015 David DeSandro
9 changes: 7 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "masonry",
"version": "3.2.2",
"version": "3.2.3",
"description": "Cascading grid layout library",
"main": "masonry.js",
"dependencies": {
Expand Down Expand Up @@ -34,5 +34,10 @@
"layout",
"outlayer"
],
"license": "MIT"
"license": "MIT",
"moduleType": [
"amd",
"globals",
"node"
]
}
2 changes: 2 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Changelog

### v3.2.3

+ Fixed pixel rounding errors related to Firefox, gutters. Fixed [#580](https://github.com/desandro/masonry/pull/580)
+ Moved poorly named `examples/` to better named `sandbox/`. Fixed [#539](https://github.com/desandro/masonry/issues/539)
+ Moved [`masonry-v2-shim.js` shim to its own repo](https://github.com/desandro/masonry-v2-3-shim)
Expand Down
83 changes: 46 additions & 37 deletions dist/masonry.pkgd.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Masonry PACKAGED v3.2.2
* Masonry PACKAGED v3.2.3
* Cascading grid layout library
* http://masonry.desandro.com
* MIT License
Expand Down Expand Up @@ -147,7 +147,7 @@ if ( typeof define === 'function' && define.amd ) {
})( window );

/*!
* eventie v1.0.5
* eventie v1.0.6
* event binding helper
* eventie.bind( elem, 'click', myFn )
* eventie.unbind( elem, 'click', myFn )
Expand Down Expand Up @@ -227,7 +227,7 @@ if ( typeof define === 'function' && define.amd ) {
window.eventie = eventie;
}

})( this );
})( window );

/*!
* docReady v1.0.4
Expand Down Expand Up @@ -1091,7 +1091,7 @@ if ( typeof define === 'function' && define.amd ) {
})( window );

/**
* matchesSelector v1.0.2
* matchesSelector v1.0.3
* matchesSelector( element, '.selector' )
* MIT license
*/
Expand All @@ -1104,6 +1104,10 @@ if ( typeof define === 'function' && define.amd ) {


var matchesMethod = ( function() {
// check for the standard method name first
if ( ElemProto.matches ) {
return 'matches';
}
// check un-prefixed
if ( ElemProto.matchesSelector ) {
return 'matchesSelector';
Expand Down Expand Up @@ -2747,14 +2751,38 @@ if ( typeof define === 'function' && define.amd ) {
})( window );

/*!
* Masonry v3.2.2
* Masonry v3.2.3
* Cascading grid layout library
* http://masonry.desandro.com
* MIT License
* by David DeSandro
*/

( function( window ) {
( function( window, factory ) {

// universal module definition
if ( typeof define === 'function' && define.amd ) {
// AMD
define( [
'outlayer/outlayer',
'get-size/get-size'
],
factory );
} else if ( typeof exports === 'object' ) {
// CommonJS
module.exports = factory(
require('outlayer'),
require('get-size')
);
} else {
// browser global
window.Masonry = factory(
window.Outlayer,
window.getSize
);
}

}( window, function factory( Outlayer, getSize ) {



Expand All @@ -2776,8 +2804,6 @@ var indexOf = Array.prototype.indexOf ?

// -------------------------- masonryDefinition -------------------------- //

// used for AMD definition and requires
function masonryDefinition( Outlayer, getSize ) {
// create an Outlayer layout class
var Masonry = Outlayer.create('masonry');

Expand Down Expand Up @@ -2809,10 +2835,17 @@ function masonryDefinition( Outlayer, getSize ) {
this.containerWidth;
}

this.columnWidth += this.gutter;

this.cols = Math.floor( ( this.containerWidth + this.gutter ) / this.columnWidth );
this.cols = Math.max( this.cols, 1 );
var columnWidth = this.columnWidth += this.gutter;

// calculate columns
var containerWidth = this.containerWidth + this.gutter;
var cols = containerWidth / columnWidth;
// fix rounding errors, typically with gutters
var excess = columnWidth - containerWidth % columnWidth;
// if overshoot is less than a pixel, round up, otherwise floor it
var mathMethod = excess && excess < 1 ? 'round' : 'floor';
cols = Math[ mathMethod ]( cols );
this.cols = Math.max( cols, 1 );
};

Masonry.prototype.getContainerWidth = function() {
Expand Down Expand Up @@ -2931,30 +2964,6 @@ function masonryDefinition( Outlayer, getSize ) {
};

return Masonry;
}

// -------------------------- transport -------------------------- //

if ( typeof define === 'function' && define.amd ) {
// AMD
define( [
'outlayer/outlayer',
'get-size/get-size'
],
masonryDefinition );
} else if ( typeof exports === 'object' ) {
// CommonJS
module.exports = masonryDefinition(
require('outlayer'),
require('get-size')
);
} else {
// browser global
window.Masonry = masonryDefinition(
window.Outlayer,
window.getSize
);
}

})( window );
}));

4 changes: 2 additions & 2 deletions dist/masonry.pkgd.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion masonry.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Masonry v3.2.2
* Masonry v3.2.3
* Cascading grid layout library
* http://masonry.desandro.com
* MIT License
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "masonry-layout",
"version": "3.2.2",
"version": "3.2.3",
"description": "Cascading grid layout library",
"main": "masonry.js",
"dependencies": {
Expand All @@ -18,7 +18,6 @@
"grunt-requirejs": "^0.4.1"
},
"directories": {
"example": "examples",
"test": "test"
},
"scripts": {
Expand Down

0 comments on commit c5c64b7

Please sign in to comment.