Skip to content

Commit ae963a1

Browse files
committed
tick version v1.3.2; build dist
2015 copyright dist update eventie 1.0.6
1 parent 78cb312 commit ae963a1

6 files changed

+45
-21
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ Add a class of `js-packery` to your element. Options can be set in JSON in `data
4646

4747
---
4848

49-
Copyright (c) 2014 Metafizzy
49+
Copyright (c) 2015 Metafizzy

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "packery",
3-
"version": "1.3.1",
3+
"version": "1.3.2",
44
"author": "David DeSandro / Metafizzy",
55
"description": "bin-packing layout library",
66
"main": [

dist/packery.pkgd.js

+36-12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Packery PACKAGED v1.3.1
2+
* Packery PACKAGED v1.3.2
33
* bin-packing layout library
44
* http://packery.metafizzy.co
55
*
@@ -8,7 +8,7 @@
88
*
99
* Non-commercial use is licensed under the GPL v3 License
1010
*
11-
* Copyright 2014 Metafizzy
11+
* Copyright 2015 Metafizzy
1212
*/
1313

1414
/**
@@ -545,7 +545,7 @@ if ( typeof define === 'function' && define.amd ) {
545545
})( window );
546546

547547
/*!
548-
* eventie v1.0.5
548+
* eventie v1.0.6
549549
* event binding helper
550550
* eventie.bind( elem, 'click', myFn )
551551
* eventie.unbind( elem, 'click', myFn )
@@ -625,7 +625,7 @@ if ( typeof define === 'function' && define.amd ) {
625625
window.eventie = eventie;
626626
}
627627

628-
})( this );
628+
})( window );
629629

630630
/*!
631631
* docReady v1.0.4
@@ -3357,7 +3357,7 @@ if ( typeof define === 'function' && define.amd ) {
33573357
})( window );
33583358

33593359
/*!
3360-
* Packery v1.3.1
3360+
* Packery v1.3.2
33613361
* bin-packing layout library
33623362
* http://packery.metafizzy.co
33633363
*
@@ -3366,18 +3366,25 @@ if ( typeof define === 'function' && define.amd ) {
33663366
*
33673367
* Non-commercial use is licensed under the GPL v3 License
33683368
*
3369-
* Copyright 2014 Metafizzy
3369+
* Copyright 2015 Metafizzy
33703370
*/
33713371

33723372
( function( window ) {
33733373

33743374

33753375

3376-
// -------------------------- Packery -------------------------- //
3377-
33783376
// used for AMD definition and requires
33793377
function packeryDefinition( classie, getSize, Outlayer, Rect, Packer, Item ) {
33803378

3379+
// ----- Rect ----- //
3380+
3381+
// allow for pixel rounding errors IE8-IE11 & Firefox; #227
3382+
Rect.prototype.canFit = function( rect ) {
3383+
return this.width >= rect.width - 1 && this.height >= rect.height - 1;
3384+
};
3385+
3386+
// -------------------------- Packery -------------------------- //
3387+
33813388
// create an Outlayer layout class
33823389
var Packery = Outlayer.create('packery');
33833390
Packery.Item = Item;
@@ -3500,16 +3507,33 @@ Packery.prototype._setRectSize = function( elem, rect ) {
35003507
// size for columnWidth and rowHeight, if available
35013508
// only check if size is non-zero, #177
35023509
if ( w || h ) {
3503-
var colW = this.columnWidth + this.gutter;
3504-
var rowH = this.rowHeight + this.gutter;
3505-
w = this.columnWidth ? Math.ceil( w / colW ) * colW : w + this.gutter;
3506-
h = this.rowHeight ? Math.ceil( h / rowH ) * rowH : h + this.gutter;
3510+
w = this._applyGridGutter( w, this.columnWidth );
3511+
h = this._applyGridGutter( h, this.rowHeight );
35073512
}
35083513
// rect must fit in packer
35093514
rect.width = Math.min( w, this.packer.width );
35103515
rect.height = Math.min( h, this.packer.height );
35113516
};
35123517

3518+
/**
3519+
* fits item to columnWidth/rowHeight and adds gutter
3520+
* @param {Number} measurement - item width or height
3521+
* @param {Number} gridSize - columnWidth or rowHeight
3522+
* @returns measurement
3523+
*/
3524+
Packery.prototype._applyGridGutter = function( measurement, gridSize ) {
3525+
// just add gutter if no gridSize
3526+
if ( !gridSize ) {
3527+
return measurement + this.gutter;
3528+
}
3529+
gridSize += this.gutter;
3530+
// fit item to columnWidth/rowHeight
3531+
var remainder = measurement % gridSize;
3532+
var mathMethod = remainder && remainder < 1 ? 'round' : 'ceil';
3533+
measurement = Math[ mathMethod ]( measurement / gridSize ) * gridSize;
3534+
return measurement;
3535+
};
3536+
35133537
Packery.prototype._getContainerSize = function() {
35143538
if ( this.options.isHorizontal ) {
35153539
return {

dist/packery.pkgd.min.js

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/packery.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Packery v1.3.1
2+
* Packery v1.3.2
33
* bin-packing layout library
44
* http://packery.metafizzy.co
55
*
@@ -8,7 +8,7 @@
88
*
99
* Non-commercial use is licensed under the GPL v3 License
1010
*
11-
* Copyright 2014 Metafizzy
11+
* Copyright 2015 Metafizzy
1212
*/
1313

1414
( function( window ) {

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "packery",
3-
"version": "1.3.1",
3+
"version": "1.3.2",
44
"description": "bin-packing layout library",
55
"main": "js/packery.js",
66
"dependencies": {

0 commit comments

Comments
 (0)