Browse Source

tests : update centered masonry for v1.3

pull/96/head
David DeSandro 14 years ago
parent
commit
719f9c84a1
  1. 13
      _posts/tests/2011-05-18-centered-masonry.html

13
_posts/tests/2011-05-18-centered-masonry.html

@ -92,21 +92,16 @@ category: tests
var i = this.masonry.cols; var i = this.masonry.cols;
this.masonry.colYs = []; this.masonry.colYs = [];
while (i--) { while (i--) {
this.masonry.colYs.push( this.posTop ); this.masonry.colYs.push( 0 );
} }
return this; return this;
}; };
$.Isotope.prototype._masonryResize = function() { $.Isotope.prototype._masonryResizeChanged = function() {
var prevColCount = this.masonry.cols; var prevColCount = this.masonry.cols;
// get updated colCount // get updated colCount
this._getCenteredMasonryColumns(); this._getCenteredMasonryColumns();
if ( this.masonry.cols !== prevColCount ) { return ( this.masonry.cols !== prevColCount )
// if column count has changed, do a new column cound
this.reLayout();
}
return this;
}; };
$.Isotope.prototype._masonryGetContainerSize = function() { $.Isotope.prototype._masonryGetContainerSize = function() {
@ -117,7 +112,7 @@ category: tests
var layoutWidth = this.masonry.cols * this.masonry.columnWidth, var layoutWidth = this.masonry.cols * this.masonry.columnWidth,
size = { size = {
height : Math.max.apply( Math, this.masonry.colYs ) - this.posTop, height : Math.max.apply( Math, this.masonry.colYs ),
width : Math.min(layoutWidth, itemsTotalWidth ) width : Math.min(layoutWidth, itemsTotalWidth )
}; };
return size; return size;

Loading…
Cancel
Save