Browse Source

src : bring all layout methods into Isotope.prototype object

pull/14/head
David DeSandro 14 years ago
parent
commit
bf115198d9
  1. 51
      jquery.isotope.js

51
jquery.isotope.js

@ -768,18 +768,13 @@ window.Modernizr = window.Modernizr || (function(window,doc,undefined){
return this; return this;
} },
};
// ====================== LAYOUTS ====================== // ====================== LAYOUTS ======================
// ====================== Masonry ====================== // ====================== Masonry ======================
$.extend( $.Isotope.prototype, {
_masonryPlaceBrick : function( $brick, setCount, setY ) { _masonryPlaceBrick : function( $brick, setCount, setY ) {
// here, `this` refers to a child element or "brick" // here, `this` refers to a child element or "brick"
// get the minimum Y value from the columns // get the minimum Y value from the columns
@ -854,8 +849,6 @@ window.Modernizr = window.Modernizr || (function(window,doc,undefined){
return this; return this;
}, },
_masonryResize : function() { _masonryResize : function() {
var prevColCount = this.masonry.cols; var prevColCount = this.masonry.cols;
// get updated colCount // get updated colCount
@ -871,14 +864,11 @@ window.Modernizr = window.Modernizr || (function(window,doc,undefined){
_masonryGetContainerSize : function() { _masonryGetContainerSize : function() {
var containerHeight = Math.max.apply( Math, this.masonry.colYs ) - this.posTop; var containerHeight = Math.max.apply( Math, this.masonry.colYs ) - this.posTop;
return { height: containerHeight }; return { height: containerHeight };
} },
});
// ====================== fitRows ====================== // ====================== fitRows ======================
$.extend( $.Isotope.prototype, {
_fitRowsLayout : function( $elems ) { _fitRowsLayout : function( $elems ) {
this.width = this.element.width(); this.width = this.element.width();
var instance = this; var instance = this;
@ -921,15 +911,11 @@ window.Modernizr = window.Modernizr || (function(window,doc,undefined){
_fitRowsResize : function() { _fitRowsResize : function() {
return this.reLayout() return this.reLayout()
} },
});
// ====================== cellsByRow ====================== // ====================== cellsByRow ======================
$.extend( $.Isotope.prototype, {
_cellsByRowReset : function() { _cellsByRowReset : function() {
this.cellsByRow = {}; this.cellsByRow = {};
this._getSegments('cellsByRow'); this._getSegments('cellsByRow');
@ -965,14 +951,11 @@ window.Modernizr = window.Modernizr || (function(window,doc,undefined){
this.reLayout(); this.reLayout();
} }
return this; return this;
} },
});
// ====================== verticalList ====================== // ====================== verticalList ======================
$.extend( $.Isotope.prototype, {
_verticalListReset : function() { _verticalListReset : function() {
this.verticalList = { this.verticalList = {
y : 0 y : 0
@ -998,14 +981,11 @@ window.Modernizr = window.Modernizr || (function(window,doc,undefined){
_verticalListResize : function() { _verticalListResize : function() {
this.reLayout(); this.reLayout();
return this; return this;
} },
});
// ====================== masonryHorizontal ====================== // ====================== masonryHorizontal ======================
$.extend( $.Isotope.prototype, {
_masonryHorizontalPlaceBrick : function( $brick, setCount, setX ) { _masonryHorizontalPlaceBrick : function( $brick, setCount, setX ) {
// here, `this` refers to a child element or "brick" // here, `this` refers to a child element or "brick"
// get the minimum Y value from the columns // get the minimum Y value from the columns
@ -1093,15 +1073,11 @@ window.Modernizr = window.Modernizr || (function(window,doc,undefined){
_masonryHorizontalGetContainerSize : function() { _masonryHorizontalGetContainerSize : function() {
var containerWidth = Math.max.apply( Math, this.masonryHorizontal.rowXs ) - this.posLeft; var containerWidth = Math.max.apply( Math, this.masonryHorizontal.rowXs ) - this.posLeft;
return { width: containerWidth }; return { width: containerWidth };
} },
});
// ====================== fitColumns ====================== // ====================== fitColumns ======================
$.extend( $.Isotope.prototype, {
_fitColumnsReset : function() { _fitColumnsReset : function() {
this.fitColumns = { this.fitColumns = {
x : 0, x : 0,
@ -1143,17 +1119,12 @@ window.Modernizr = window.Modernizr || (function(window,doc,undefined){
_fitColumnsResize : function() { _fitColumnsResize : function() {
return this.reLayout(); return this.reLayout();
} },
});
// ====================== cellsByColumn ====================== // ====================== cellsByColumn ======================
$.extend( $.Isotope.prototype, {
_cellsByColumnReset : function() { _cellsByColumnReset : function() {
this.cellsByColumn = {}; this.cellsByColumn = {};
this._getSegments( 'cellsByColumn', true ); this._getSegments( 'cellsByColumn', true );
@ -1190,8 +1161,8 @@ window.Modernizr = window.Modernizr || (function(window,doc,undefined){
} }
return this; return this;
} }
});
};
// ======================= imagesLoaded Plugin =============================== // ======================= imagesLoaded Plugin ===============================

Loading…
Cancel
Save