Skip to content

Instantly share code, notes, and snippets.

@desandro
Created August 24, 2014 02:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save desandro/78bb19987e77ab3cca91 to your computer and use it in GitHub Desktop.
Save desandro/78bb19987e77ab3cca91 to your computer and use it in GitHub Desktop.
// Modify fitColumns layout mode to not resize container
// and support percentage width items
var FitColumns = Isotope.LayoutMode.modes.fitColumns;
FitColumns.prototype._getContainerSize = function() {};
FitColumns.prototype.needsResizeLayout = function() {
// don't trigger if size did not change
var size = getSize( this.isotope.element );
if ( this.isotope.size && size ) {
return size.innerHeight !== this.isotope.size.innerHeight ||
size.innerWidth !== this.isotope.size.innerWidth;
} else {
return false;
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment