Browse Source

Merge branch 'master' into gh-pages

v1
David DeSandro 13 years ago
parent
commit
36f709ee3d
  1. 238
      jquery.isotope.js

238
jquery.isotope.js

@ -53,7 +53,7 @@
var transformProp = getStyleProperty('transform'), var transformProp = getStyleProperty('transform'),
transitionProp = getStyleProperty('transitionProperty'); transitionProp = getStyleProperty('transitionProperty');
// ========================= miniModernizr =============================== // ========================= miniModernizr ===============================
// <3<3<3 and thanks to Faruk and Paul for doing the heavy lifting // <3<3<3 and thanks to Faruk and Paul for doing the heavy lifting
@ -62,7 +62,7 @@
* Modernizr v1.6ish: miniModernizr for Isotope * Modernizr v1.6ish: miniModernizr for Isotope
* http://www.modernizr.com * http://www.modernizr.com
* *
* Developed by: * Developed by:
* - Faruk Ates http://farukat.es/ * - Faruk Ates http://farukat.es/
* - Paul Irish http://paulirish.com/ * - Paul Irish http://paulirish.com/
* *
@ -75,7 +75,7 @@
* This version whittles down the script just to check support for * This version whittles down the script just to check support for
* CSS transitions, transforms, and 3D transforms. * CSS transitions, transforms, and 3D transforms.
*/ */
var tests = { var tests = {
csstransforms: function() { csstransforms: function() {
return !!transformProp; return !!transformProp;
@ -143,11 +143,11 @@
* Uses hardware accelerated 3D transforms for Safari * Uses hardware accelerated 3D transforms for Safari
* or falls back to 2D transforms. * or falls back to 2D transforms.
*/ */
if ( Modernizr.csstransforms ) { if ( Modernizr.csstransforms ) {
// i.e. transformFnNotations.scale(0.5) >> 'scale3d( 0.5, 0.5, 1)' // i.e. transformFnNotations.scale(0.5) >> 'scale3d( 0.5, 0.5, 1)'
var transformFnNotations = Modernizr.csstransforms3d ? var transformFnNotations = Modernizr.csstransforms3d ?
{ // 3D transform functions { // 3D transform functions
translate : function ( position ) { translate : function ( position ) {
return 'translate3d(' + position[0] + 'px, ' + position[1] + 'px, 0) '; return 'translate3d(' + position[0] + 'px, ' + position[1] + 'px, 0) ';
@ -198,11 +198,11 @@
// set name to vendor specific property // set name to vendor specific property
elem.style[ transformProp ] = valueFns; elem.style[ transformProp ] = valueFns;
}; };
// ==================== scale =================== // ==================== scale ===================
$.cssNumber.scale = true; $.cssNumber.scale = true;
$.cssHooks.scale = { $.cssHooks.scale = {
set: function( elem, value ) { set: function( elem, value ) {
// uncomment this bit if you want to properly parse strings // uncomment this bit if you want to properly parse strings
@ -220,12 +220,12 @@
$.fx.step.scale = function( fx ) { $.fx.step.scale = function( fx ) {
$.cssHooks.scale.set( fx.elem, fx.now+fx.unit ); $.cssHooks.scale.set( fx.elem, fx.now+fx.unit );
}; };
// ==================== translate =================== // ==================== translate ===================
$.cssNumber.translate = true; $.cssNumber.translate = true;
$.cssHooks.translate = { $.cssHooks.translate = {
set: function( elem, value ) { set: function( elem, value ) {
@ -233,7 +233,7 @@
// if ( typeof value === 'string' ) { // if ( typeof value === 'string' ) {
// value = value.split(' '); // value = value.split(' ');
// } // }
// //
// var i, val; // var i, val;
// for ( i = 0; i < 2; i++ ) { // for ( i = 0; i < 2; i++ ) {
// val = value[i]; // val = value[i];
@ -244,7 +244,7 @@
setIsoTransform( elem, 'translate', value ); setIsoTransform( elem, 'translate', value );
}, },
get: function( elem, computed ) { get: function( elem, computed ) {
var transform = $.data( elem, 'isoTransform' ); var transform = $.data( elem, 'isoTransform' );
return transform && transform.translate ? transform.translate : [ 0, 0 ]; return transform && transform.translate ? transform.translate : [ 0, 0 ];
@ -252,10 +252,10 @@
}; };
} }
// ========================= get transition-end event =============================== // ========================= get transition-end event ===============================
var transitionEndEvent, transitionDurProp; var transitionEndEvent, transitionDurProp;
if ( Modernizr.csstransitions ) { if ( Modernizr.csstransitions ) {
transitionEndEvent = { transitionEndEvent = {
WebkitTransitionProperty: 'webkitTransitionEnd', // webkit WebkitTransitionProperty: 'webkitTransitionEnd', // webkit
@ -320,7 +320,7 @@
this._create( options ); this._create( options );
this._init( callback ); this._init( callback );
}; };
// styles of container element we want to keep track of // styles of container element we want to keep track of
var isoContainerStyles = [ 'width', 'height' ]; var isoContainerStyles = [ 'width', 'height' ];
@ -354,9 +354,9 @@
// sets up widget // sets up widget
_create : function( options ) { _create : function( options ) {
this.options = $.extend( {}, $.Isotope.settings, options ); this.options = $.extend( {}, $.Isotope.settings, options );
this.styleQueue = []; this.styleQueue = [];
this.elemCount = 0; this.elemCount = 0;
@ -374,10 +374,10 @@
} }
// apply container style from options // apply container style from options
this.element.css( this.options.containerStyle ); this.element.css( this.options.containerStyle );
this._updateAnimationEngine(); this._updateAnimationEngine();
this._updateUsingTransforms(); this._updateUsingTransforms();
// sorting // sorting
var originalOrderSorter = { var originalOrderSorter = {
'original-order' : function( $elem, instance ) { 'original-order' : function( $elem, instance ) {
@ -393,7 +393,7 @@
// need to get atoms // need to get atoms
this.reloadItems(); this.reloadItems();
// get top left position of where the bricks should be // get top left position of where the bricks should be
this.offset = { this.offset = {
left: parseInt( this.element.css('padding-left'), 10 ), left: parseInt( this.element.css('padding-left'), 10 ),
@ -405,28 +405,28 @@
setTimeout( function() { setTimeout( function() {
instance.element.addClass( instance.options.containerClass ); instance.element.addClass( instance.options.containerClass );
}, 0 ); }, 0 );
// bind resize method // bind resize method
if ( this.options.resizable ) { if ( this.options.resizable ) {
$window.bind( 'smartresize.isotope', function() { $window.bind( 'smartresize.isotope', function() {
instance.resize(); instance.resize();
}); });
} }
// dismiss all click events from hidden events // dismiss all click events from hidden events
this.element.delegate( '.' + this.options.hiddenClass, 'click', function(){ this.element.delegate( '.' + this.options.hiddenClass, 'click', function(){
return false; return false;
}); });
}, },
_getAtoms : function( $elems ) { _getAtoms : function( $elems ) {
var selector = this.options.itemSelector, var selector = this.options.itemSelector,
// filter & find // filter & find
$atoms = selector ? $elems.filter( selector ).add( $elems.find( selector ) ) : $elems, $atoms = selector ? $elems.filter( selector ).add( $elems.find( selector ) ) : $elems,
// base style for atoms // base style for atoms
atomStyle = { position: 'absolute' }; atomStyle = { position: 'absolute' };
if ( this.usingTransforms ) { if ( this.usingTransforms ) {
atomStyle.left = 0; atomStyle.left = 0;
atomStyle.top = 0; atomStyle.top = 0;
@ -435,16 +435,16 @@
$atoms.css( atomStyle ).addClass( this.options.itemClass ); $atoms.css( atomStyle ).addClass( this.options.itemClass );
this.updateSortData( $atoms, true ); this.updateSortData( $atoms, true );
return $atoms; return $atoms;
}, },
// _init fires when your instance is first created // _init fires when your instance is first created
// (from the constructor above), and when you // (from the constructor above), and when you
// attempt to initialize the widget again (by the bridge) // attempt to initialize the widget again (by the bridge)
// after it has already been initialized. // after it has already been initialized.
_init : function( callback ) { _init : function( callback ) {
this.$filteredAtoms = this._filter( this.$allAtoms ); this.$filteredAtoms = this._filter( this.$allAtoms );
this._sort(); this._sort();
this.reLayout( callback ); this.reLayout( callback );
@ -467,10 +467,10 @@
} }
} }
}, },
// ====================== updaters ====================== // // ====================== updaters ====================== //
// kind of like setters // kind of like setters
_updateAnimationEngine : function() { _updateAnimationEngine : function() {
var animationEngine = this.options.animationEngine.toLowerCase().replace( /[ _\-]/g, ''); var animationEngine = this.options.animationEngine.toLowerCase().replace( /[ _\-]/g, '');
var isUsingJQueryAnimation; var isUsingJQueryAnimation;
@ -489,13 +489,13 @@
this.isUsingJQueryAnimation = isUsingJQueryAnimation; this.isUsingJQueryAnimation = isUsingJQueryAnimation;
this._updateUsingTransforms(); this._updateUsingTransforms();
}, },
_updateTransformsEnabled : function() { _updateTransformsEnabled : function() {
this._updateUsingTransforms(); this._updateUsingTransforms();
}, },
_updateUsingTransforms : function() { _updateUsingTransforms : function() {
var usingTransforms = this.usingTransforms = this.options.transformsEnabled && var usingTransforms = this.usingTransforms = this.options.transformsEnabled &&
Modernizr.csstransforms && Modernizr.csstransitions && !this.isUsingJQueryAnimation; Modernizr.csstransforms && Modernizr.csstransitions && !this.isUsingJQueryAnimation;
// prevent scales when transforms are disabled // prevent scales when transforms are disabled
@ -507,7 +507,7 @@
this.getPositionStyles = usingTransforms ? this._translate : this._positionAbs; this.getPositionStyles = usingTransforms ? this._translate : this._positionAbs;
}, },
// ====================== Filtering ====================== // ====================== Filtering ======================
_filter : function( $atoms ) { _filter : function( $atoms ) {
@ -533,9 +533,9 @@
return $atoms.filter( filter ); return $atoms.filter( filter );
}, },
// ====================== Sorting ====================== // ====================== Sorting ======================
updateSortData : function( $atoms, isIncrementingElemCount ) { updateSortData : function( $atoms, isIncrementingElemCount ) {
var instance = this, var instance = this,
getSortData = this.options.getSortData, getSortData = this.options.getSortData,
@ -556,10 +556,10 @@
$.data( this, 'isotope-sort-data', sortData ); $.data( this, 'isotope-sort-data', sortData );
}); });
}, },
// used on all the filtered atoms // used on all the filtered atoms
_sort : function() { _sort : function() {
var sortBy = this.options.sortBy, var sortBy = this.options.sortBy,
getSorter = this._getSorter, getSorter = this._getSorter,
sortDir = this.options.sortAscending ? 1 : -1, sortDir = this.options.sortAscending ? 1 : -1,
@ -573,7 +573,7 @@
} }
return ( ( a > b ) ? 1 : ( a < b ) ? -1 : 0 ) * sortDir; return ( ( a > b ) ? 1 : ( a < b ) ? -1 : 0 ) * sortDir;
}; };
this.$filteredAtoms.sort( sortFn ); this.$filteredAtoms.sort( sortFn );
}, },
@ -586,7 +586,7 @@
_translate : function( x, y ) { _translate : function( x, y ) {
return { translate : [ x, y ] }; return { translate : [ x, y ] };
}, },
_positionAbs : function( x, y ) { _positionAbs : function( x, y ) {
return { left: x, top: y }; return { left: x, top: y };
}, },
@ -612,7 +612,7 @@
// layout logic // layout logic
this[ '_' + layoutMode + 'Layout' ]( $elems ); this[ '_' + layoutMode + 'Layout' ]( $elems );
// set the size of the container // set the size of the container
if ( this.options.resizesContainer ) { if ( this.options.resizesContainer ) {
var containerStyle = this[ '_' + layoutMode + 'GetContainerSize' ](); var containerStyle = this[ '_' + layoutMode + 'GetContainerSize' ]();
@ -620,10 +620,10 @@
} }
this._processStyleQueue( $elems, callback ); this._processStyleQueue( $elems, callback );
this.isLaidOut = true; this.isLaidOut = true;
}, },
_processStyleQueue : function( $elems, callback ) { _processStyleQueue : function( $elems, callback ) {
// are we animating the layout arrangement? // are we animating the layout arrangement?
// use plugin-ish syntax for css or animate // use plugin-ish syntax for css or animate
@ -647,7 +647,7 @@
objStyleFn = obj.$el.hasClass('no-transition') ? 'css' : styleFn; objStyleFn = obj.$el.hasClass('no-transition') ? 'css' : styleFn;
obj.$el[ objStyleFn ]( obj.style, animOpts ); obj.$el[ objStyleFn ]( obj.style, animOpts );
}; };
} else if ( callback || onLayout || animOpts.complete ) { } else if ( callback || onLayout || animOpts.complete ) {
// has callback // has callback
var isCallbackTriggered = false, var isCallbackTriggered = false,
@ -669,7 +669,7 @@
} }
isCallbackTriggered = true; isCallbackTriggered = true;
}; };
if ( this.isUsingJQueryAnimation && styleFn === 'animate' ) { if ( this.isUsingJQueryAnimation && styleFn === 'animate' ) {
// add callback to animation options // add callback to animation options
animOpts.complete = callbackFn; animOpts.complete = callbackFn;
@ -706,7 +706,7 @@
// process styleQueue // process styleQueue
$.each( this.styleQueue, processor ); $.each( this.styleQueue, processor );
if ( triggerCallbackNow ) { if ( triggerCallbackNow ) {
callbackFn(); callbackFn();
} }
@ -714,26 +714,26 @@
// clear out queue for next time // clear out queue for next time
this.styleQueue = []; this.styleQueue = [];
}, },
resize : function() { resize : function() {
if ( this[ '_' + this.options.layoutMode + 'ResizeChanged' ]() ) { if ( this[ '_' + this.options.layoutMode + 'ResizeChanged' ]() ) {
this.reLayout(); this.reLayout();
} }
}, },
reLayout : function( callback ) { reLayout : function( callback ) {
this[ '_' + this.options.layoutMode + 'Reset' ](); this[ '_' + this.options.layoutMode + 'Reset' ]();
this.layout( this.$filteredAtoms, callback ); this.layout( this.$filteredAtoms, callback );
}, },
// ====================== Convenience methods ====================== // ====================== Convenience methods ======================
// ====================== Adding items ====================== // ====================== Adding items ======================
// adds a jQuery object of items to a isotope container // adds a jQuery object of items to a isotope container
addItems : function( $content, callback ) { addItems : function( $content, callback ) {
var $newAtoms = this._getAtoms( $content ); var $newAtoms = this._getAtoms( $content );
@ -744,13 +744,13 @@
callback( $newAtoms ); callback( $newAtoms );
} }
}, },
// convienence method for adding elements properly to any layout // convienence method for adding elements properly to any layout
// positions items, hides them, then animates them back in <--- very sezzy // positions items, hides them, then animates them back in <--- very sezzy
insert : function( $content, callback ) { insert : function( $content, callback ) {
// position items // position items
this.element.append( $content ); this.element.append( $content );
var instance = this; var instance = this;
this.addItems( $content, function( $newAtoms ) { this.addItems( $content, function( $newAtoms ) {
var $newFilteredAtoms = instance._filter( $newAtoms ); var $newFilteredAtoms = instance._filter( $newAtoms );
@ -759,9 +759,9 @@
instance.reLayout(); instance.reLayout();
instance._revealAppended( $newFilteredAtoms, callback ); instance._revealAppended( $newFilteredAtoms, callback );
}); });
}, },
// convienence method for working with Infinite Scroll // convienence method for working with Infinite Scroll
appended : function( $content, callback ) { appended : function( $content, callback ) {
var instance = this; var instance = this;
@ -771,18 +771,18 @@
instance._revealAppended( $newAtoms, callback ); instance._revealAppended( $newAtoms, callback );
}); });
}, },
// adds new atoms, then hides them before positioning // adds new atoms, then hides them before positioning
_addHideAppended : function( $newAtoms ) { _addHideAppended : function( $newAtoms ) {
this.$filteredAtoms = this.$filteredAtoms.add( $newAtoms ); this.$filteredAtoms = this.$filteredAtoms.add( $newAtoms );
$newAtoms.addClass('no-transition'); $newAtoms.addClass('no-transition');
this._isInserting = true; this._isInserting = true;
// apply hidden styles // apply hidden styles
this.styleQueue.push({ $el: $newAtoms, style: this.options.hiddenStyle }); this.styleQueue.push({ $el: $newAtoms, style: this.options.hiddenStyle });
}, },
// sets visible style on new atoms // sets visible style on new atoms
_revealAppended : function( $newAtoms, callback ) { _revealAppended : function( $newAtoms, callback ) {
var instance = this; var instance = this;
@ -796,12 +796,12 @@
instance._processStyleQueue( $newAtoms, callback ); instance._processStyleQueue( $newAtoms, callback );
}, 10 ); }, 10 );
}, },
// gathers all atoms // gathers all atoms
reloadItems : function() { reloadItems : function() {
this.$allAtoms = this._getAtoms( this.element.children() ); this.$allAtoms = this._getAtoms( this.element.children() );
}, },
// removes elements from Isotope widget // removes elements from Isotope widget
remove: function( $content, callback ) { remove: function( $content, callback ) {
// remove elements from Isotope instance in callback // remove elements from Isotope instance in callback
@ -827,14 +827,14 @@
} }
}, },
shuffle : function( callback ) { shuffle : function( callback ) {
this.updateSortData( this.$allAtoms ); this.updateSortData( this.$allAtoms );
this.options.sortBy = 'random'; this.options.sortBy = 'random';
this._sort(); this._sort();
this.reLayout( callback ); this.reLayout( callback );
}, },
// destroys widget, returns elements and container back (close) to original style // destroys widget, returns elements and container back (close) to original style
destroy : function() { destroy : function() {
@ -853,26 +853,26 @@
style[ transformProp ] = ''; style[ transformProp ] = '';
} }
}); });
// re-apply saved container styles // re-apply saved container styles
var elemStyle = this.element[0].style; var elemStyle = this.element[0].style;
for ( var prop in this.originalStyle ) { for ( var prop in this.originalStyle ) {
elemStyle[ prop ] = this.originalStyle[ prop ]; elemStyle[ prop ] = this.originalStyle[ prop ];
} }
this.element this.element
.unbind('.isotope') .unbind('.isotope')
.undelegate( '.' + options.hiddenClass, 'click' ) .undelegate( '.' + options.hiddenClass, 'click' )
.removeClass( options.containerClass ) .removeClass( options.containerClass )
.removeData('isotope'); .removeData('isotope');
$window.unbind('.isotope'); $window.unbind('.isotope');
}, },
// ====================== LAYOUTS ====================== // ====================== LAYOUTS ======================
// calculates number of rows or columns // calculates number of rows or columns
// requires columnWidth or rowHeight to be set on namespaced object // requires columnWidth or rowHeight to be set on namespaced object
// i.e. this.masonry.columnWidth = 200 // i.e. this.masonry.columnWidth = 200
@ -889,7 +889,7 @@
this.$filteredAtoms[ 'outer' + capitalize(size) ](true) || this.$filteredAtoms[ 'outer' + capitalize(size) ](true) ||
// if there's no items, use size of container // if there's no items, use size of container
containerSize; containerSize;
segments = Math.floor( containerSize / segmentSize ); segments = Math.floor( containerSize / segmentSize );
segments = Math.max( segments, 1 ); segments = Math.max( segments, 1 );
@ -897,9 +897,9 @@
this[ namespace ][ segmentsName ] = segments; this[ namespace ][ segmentsName ] = segments;
// i.e. this.masonry.columnWidth = ... // i.e. this.masonry.columnWidth = ...
this[ namespace ][ measure ] = segmentSize; this[ namespace ][ measure ] = segmentSize;
}, },
_checkIfSegmentsChanged : function( isRows ) { _checkIfSegmentsChanged : function( isRows ) {
var namespace = this.options.layoutMode, var namespace = this.options.layoutMode,
segmentsName = isRows ? 'rows' : 'cols', segmentsName = isRows ? 'rows' : 'cols',
@ -911,7 +911,7 @@
}, },
// ====================== Masonry ====================== // ====================== Masonry ======================
_masonryReset : function() { _masonryReset : function() {
// layout-specific props // layout-specific props
this.masonry = {}; this.masonry = {};
@ -923,7 +923,7 @@
this.masonry.colYs.push( 0 ); this.masonry.colYs.push( 0 );
} }
}, },
_masonryLayout : function( $elems ) { _masonryLayout : function( $elems ) {
var instance = this, var instance = this,
props = instance.masonry; props = instance.masonry;
@ -951,12 +951,12 @@
// and get the max value of the array // and get the max value of the array
groupY[i] = Math.max.apply( Math, groupColY ); groupY[i] = Math.max.apply( Math, groupColY );
} }
instance._masonryPlaceBrick( $this, groupY ); instance._masonryPlaceBrick( $this, groupY );
} }
}); });
}, },
// worker method that places brick in the columnSet // worker method that places brick in the columnSet
// with the the minY // with the the minY
_masonryPlaceBrick : function( $brick, setY ) { _masonryPlaceBrick : function( $brick, setY ) {
@ -971,7 +971,7 @@
break; break;
} }
} }
// position the brick // position the brick
var x = this.masonry.columnWidth * shortCol, var x = this.masonry.columnWidth * shortCol,
y = minimumY; y = minimumY;
@ -985,18 +985,18 @@
} }
}, },
_masonryGetContainerSize : function() { _masonryGetContainerSize : function() {
var containerHeight = Math.max.apply( Math, this.masonry.colYs ); var containerHeight = Math.max.apply( Math, this.masonry.colYs );
return { height: containerHeight }; return { height: containerHeight };
}, },
_masonryResizeChanged : function() { _masonryResizeChanged : function() {
return this._checkIfSegmentsChanged(); return this._checkIfSegmentsChanged();
}, },
// ====================== fitRows ====================== // ====================== fitRows ======================
_fitRowsReset : function() { _fitRowsReset : function() {
this.fitRows = { this.fitRows = {
x : 0, x : 0,
@ -1004,43 +1004,43 @@
height : 0 height : 0
}; };
}, },
_fitRowsLayout : function( $elems ) { _fitRowsLayout : function( $elems ) {
var instance = this, var instance = this,
containerWidth = this.element.width(), containerWidth = this.element.width(),
props = this.fitRows; props = this.fitRows;
$elems.each( function() { $elems.each( function() {
var $this = $(this), var $this = $(this),
atomW = $this.outerWidth(true), atomW = $this.outerWidth(true),
atomH = $this.outerHeight(true); atomH = $this.outerHeight(true);
if ( props.x !== 0 && atomW + props.x > containerWidth ) { if ( props.x !== 0 && atomW + props.x > containerWidth ) {
// if this element cannot fit in the current row // if this element cannot fit in the current row
props.x = 0; props.x = 0;
props.y = props.height; props.y = props.height;
} }
// position the atom // position the atom
instance._pushPosition( $this, props.x, props.y ); instance._pushPosition( $this, props.x, props.y );
props.height = Math.max( props.y + atomH, props.height ); props.height = Math.max( props.y + atomH, props.height );
props.x += atomW; props.x += atomW;
}); });
}, },
_fitRowsGetContainerSize : function () { _fitRowsGetContainerSize : function () {
return { height : this.fitRows.height }; return { height : this.fitRows.height };
}, },
_fitRowsResizeChanged : function() { _fitRowsResizeChanged : function() {
return true; return true;
}, },
// ====================== cellsByRow ====================== // ====================== cellsByRow ======================
_cellsByRowReset : function() { _cellsByRowReset : function() {
this.cellsByRow = { this.cellsByRow = {
index : 0 index : 0
@ -1072,10 +1072,10 @@
_cellsByRowResizeChanged : function() { _cellsByRowResizeChanged : function() {
return this._checkIfSegmentsChanged(); return this._checkIfSegmentsChanged();
}, },
// ====================== straightDown ====================== // ====================== straightDown ======================
_straightDownReset : function() { _straightDownReset : function() {
this.straightDown = { this.straightDown = {
y : 0 y : 0
@ -1101,7 +1101,7 @@
// ====================== masonryHorizontal ====================== // ====================== masonryHorizontal ======================
_masonryHorizontalReset : function() { _masonryHorizontalReset : function() {
// layout-specific props // layout-specific props
this.masonryHorizontal = {}; this.masonryHorizontal = {};
@ -1113,7 +1113,7 @@
this.masonryHorizontal.rowXs.push( 0 ); this.masonryHorizontal.rowXs.push( 0 );
} }
}, },
_masonryHorizontalLayout : function( $elems ) { _masonryHorizontalLayout : function( $elems ) {
var instance = this, var instance = this,
props = instance.masonryHorizontal; props = instance.masonryHorizontal;
@ -1145,7 +1145,7 @@
} }
}); });
}, },
_masonryHorizontalPlaceBrick : function( $brick, setX ) { _masonryHorizontalPlaceBrick : function( $brick, setX ) {
// get the minimum Y value from the columns // get the minimum Y value from the columns
var minimumX = Math.min.apply( Math, setX ), var minimumX = Math.min.apply( Math, setX ),
@ -1175,14 +1175,14 @@
var containerWidth = Math.max.apply( Math, this.masonryHorizontal.rowXs ); var containerWidth = Math.max.apply( Math, this.masonryHorizontal.rowXs );
return { width: containerWidth }; return { width: containerWidth };
}, },
_masonryHorizontalResizeChanged : function() { _masonryHorizontalResizeChanged : function() {
return this._checkIfSegmentsChanged(true); return this._checkIfSegmentsChanged(true);
}, },
// ====================== fitColumns ====================== // ====================== fitColumns ======================
_fitColumnsReset : function() { _fitColumnsReset : function() {
this.fitColumns = { this.fitColumns = {
x : 0, x : 0,
@ -1190,7 +1190,7 @@
width : 0 width : 0
}; };
}, },
_fitColumnsLayout : function( $elems ) { _fitColumnsLayout : function( $elems ) {
var instance = this, var instance = this,
containerHeight = this.element.height(), containerHeight = this.element.height(),
@ -1204,7 +1204,7 @@
// if this element cannot fit in the current column // if this element cannot fit in the current column
props.x = props.width; props.x = props.width;
props.y = 0; props.y = 0;
} }
// position the atom // position the atom
instance._pushPosition( $this, props.x, props.y ); instance._pushPosition( $this, props.x, props.y );
@ -1214,19 +1214,19 @@
}); });
}, },
_fitColumnsGetContainerSize : function () { _fitColumnsGetContainerSize : function () {
return { width : this.fitColumns.width }; return { width : this.fitColumns.width };
}, },
_fitColumnsResizeChanged : function() { _fitColumnsResizeChanged : function() {
return true; return true;
}, },
// ====================== cellsByColumn ====================== // ====================== cellsByColumn ======================
_cellsByColumnReset : function() { _cellsByColumnReset : function() {
this.cellsByColumn = { this.cellsByColumn = {
index : 0 index : 0
@ -1258,7 +1258,7 @@
_cellsByColumnResizeChanged : function() { _cellsByColumnResizeChanged : function() {
return this._checkIfSegmentsChanged(true); return this._checkIfSegmentsChanged(true);
}, },
// ====================== straightAcross ====================== // ====================== straightAcross ======================
_straightAcrossReset : function() { _straightAcrossReset : function() {
@ -1285,8 +1285,8 @@
} }
}; };
// ======================= imagesLoaded Plugin =============================== // ======================= imagesLoaded Plugin ===============================
/*! /*!
* jQuery imagesLoaded plugin v1.1.0 * jQuery imagesLoaded plugin v1.1.0
@ -1358,7 +1358,7 @@
// leverages data method to either create or return $.Isotope constructor // leverages data method to either create or return $.Isotope constructor
// A bit from jQuery UI // A bit from jQuery UI
// https://github.com/jquery/jquery-ui/blob/master/ui/jquery.ui.widget.js // https://github.com/jquery/jquery-ui/blob/master/ui/jquery.ui.widget.js
// A bit from jcarousel // A bit from jcarousel
// https://github.com/jsor/jcarousel/blob/master/lib/jquery.jcarousel.js // https://github.com/jsor/jcarousel/blob/master/lib/jquery.jcarousel.js
$.fn.isotope = function( options, callback ) { $.fn.isotope = function( options, callback ) {

Loading…
Cancel
Save