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