Filter & sort magical layouts http://isotope.metafizzy.co
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

50 lines
995 B

( function( window ) {
'use strict';
function horizontalDefinition( layoutMode ) {
var Horizontal = layoutMode.create( 'horizontal', {
verticalAlignment: 0
});
Horizontal.prototype._resetLayout = function() {
this.x = 0;
};
Horizontal.prototype._getItemLayoutPosition = function( item ) {
item.getSize();
var y = ( this.isotope.size.innerHeight - item.size.outerHeight ) *
this.options.verticalAlignment;
var x = this.x;
this.x += item.size.outerWidth;
console.log( x, y );
return { x: x, y: y };
};
Horizontal.prototype._getContainerSize = function() {
return { width: this.x };
};
Horizontal.prototype.resize = function() {
this.isotope.resizeVertical();
};
return Horizontal;
}
if ( typeof define === 'function' && define.amd ) {
// AMD
define( [
'../layout-mode'
],
horizontalDefinition );
} else {
// browser global
horizontalDefinition(
window.Isotope.layoutMode
);
}
})( window );