Skip to content

Commit

Permalink
update Outlayer v1.4.2 for percent fix
Browse files Browse the repository at this point in the history
Fixes #948, #955
add fluid demo
  • Loading branch information
desandro committed Aug 21, 2015
1 parent 785264a commit 0397968
Show file tree
Hide file tree
Showing 7 changed files with 107 additions and 17 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "isotope",
"version": "2.2.1",
"version": "2.2.2",
"description": "Filter and sort magical layouts",
"main": "js/isotope.js",
"dependencies": {
Expand Down
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

### v2.2.2

Updated Outlayer v1.4.2. Fixed percent width bugs. Fixed [#948](https://github.com/metafizzy/isotope/issues/948).

### v2.2.1

Updated Outlayer v1.4.1
Expand Down
22 changes: 10 additions & 12 deletions dist/isotope.pkgd.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Isotope PACKAGED v2.2.1
* Isotope PACKAGED v2.2.2
*
* Licensed GPLv3 for open source use
* or Isotope Commercial License for commercial use
Expand Down Expand Up @@ -1637,12 +1637,12 @@ Item.prototype.getPosition = function() {
var isOriginTop = layoutOptions.isOriginTop;
var xValue = style[ isOriginLeft ? 'left' : 'right' ];
var yValue = style[ isOriginTop ? 'top' : 'bottom' ];
var x = parseInt( xValue, 10 );
var y = parseInt( yValue, 10 );
// convert percent to pixels
var layoutSize = this.layout.size;
x = xValue.indexOf('%') != -1 ? ( x / 100 ) * layoutSize.width : x;
y = yValue.indexOf('%') != -1 ? ( y / 100 ) * layoutSize.height : y;
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 );

// clean up 'auto' or other non-integer values
x = isNaN( x ) ? 0 : x;
Expand Down Expand Up @@ -1738,14 +1738,12 @@ Item.prototype.getTranslate = function( x, y ) {
var layoutOptions = this.layout.options;
x = layoutOptions.isOriginLeft ? x : -x;
y = layoutOptions.isOriginTop ? y : -y;
x = this.getXValue( x );
y = this.getYValue( y );

if ( is3d ) {
return 'translate3d(' + x + ', ' + y + ', 0)';
return 'translate3d(' + x + 'px, ' + y + 'px, 0)';
}

return 'translate(' + x + ', ' + y + ')';
return 'translate(' + x + 'px, ' + y + 'px)';
};

// non transition + transform support
Expand Down Expand Up @@ -2059,7 +2057,7 @@ return Item;
}));

/*!
* Outlayer v1.4.1
* Outlayer v1.4.2
* the brains and guts of a layout library
* MIT license
*/
Expand Down Expand Up @@ -3225,7 +3223,7 @@ return Item;
}));

/*!
* Masonry v3.3.0
* Masonry v3.3.1
* Cascading grid layout library
* http://masonry.desandro.com
* MIT License
Expand Down Expand Up @@ -3629,7 +3627,7 @@ return Vertical;
}));

/*!
* Isotope v2.2.1
* Isotope v2.2.2
*
* Licensed GPLv3 for open source use
* or Isotope Commercial License for commercial use
Expand Down
4 changes: 2 additions & 2 deletions dist/isotope.pkgd.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/isotope.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Isotope v2.2.1
* Isotope v2.2.2
*
* Licensed GPLv3 for open source use
* or Isotope Commercial License for commercial use
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "isotope-layout",
"version": "2.2.1",
"version": "2.2.2",
"description": "Filter and sort magical layouts",
"main": "js/isotope.js",
"dependencies": {
Expand Down
88 changes: 88 additions & 0 deletions sandbox/fluid.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">

<title>fluid</title>

<link rel="stylesheet" href="sandbox.css" />

<style>
.container {
width: auto;
max-width: none;
}

.item, .grid-sizer { width: 50%; }
.item.w2 { width: 100%; }
.item.w3 { width: 105%; }

@media screen and (min-width: 768px) {
.item, .grid-sizer { width: 25%; }
.item.w2 { width: 50%; }
.item.w3 { width: 75%; }
}
</style>

</head>
<body>

<h1>fluid</h1>

<div class="container">
<div class="grid-sizer"></div>
<div class="item"></div>
<div class="item h4"></div>
<div class="item w2 h2"></div>
<div class="item w2"></div>
<div class="item h3"></div>
<div class="item w3"></div>
<div class="item"></div>
<div class="item h4"></div>
<div class="item"></div>
<div class="item w2 h4"></div>
<div class="item w2"></div>
<div class="item h5"></div>
<div class="item w3"></div>
<div class="item"></div>
<div class="item h4"></div>
<div class="item"></div>
<div class="item w2 h5"></div>
<div class="item w2"></div>
<div class="item h3"></div>
<div class="item w3"></div>
<div class="item"></div>
</div>

<script src="../bower_components/eventEmitter/EventEmitter.js"></script>
<script src="../bower_components/eventie/eventie.js"></script>
<script src="../bower_components/doc-ready/doc-ready.js"></script>
<script src="../bower_components/get-style-property/get-style-property.js"></script>
<script src="../bower_components/get-size/get-size.js"></script>
<script src="../bower_components/jquery-bridget/jquery.bridget.js"></script>
<script src="../bower_components/matches-selector/matches-selector.js"></script>
<script src="../bower_components/fizzy-ui-utils/utils.js"></script>
<script src="../bower_components/outlayer/item.js"></script>
<script src="../bower_components/outlayer/outlayer.js"></script>
<script src="../bower_components/masonry/masonry.js"></script>

<script src="../js/layout-mode.js"></script>
<script src="../js/item.js"></script>
<script src="../js/isotope.js"></script>
<script src="../js/layout-modes/fit-rows.js"></script>
<script src="../js/layout-modes/masonry.js"></script>

<script>
docReady( function() {
var iso = window.iso = new Isotope( '.container', {
itemSelector: '.item',
percentPosition: true,
masonry: {
columnWidth: '.grid-sizer'
}
});
});
</script>

</body>
</html>

0 comments on commit 0397968

Please sign in to comment.