diff --git a/bower.json b/bower.json index cd920f8..f3083e3 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "isotope", - "version": "2.0.0-beta.4", + "version": "2.0.0-beta.5", "description": "Filter and sort magical layouts", "main": [ "js/item.js", diff --git a/js/isotope.js b/js/isotope.js index 6083c13..a80316a 100644 --- a/js/isotope.js +++ b/js/isotope.js @@ -1,5 +1,5 @@ /*! - * Isotope v2.0.0-beta.4 + * Isotope v2.0.0-beta.5 * Magical sorting and filtering layouts * http://isotope.metafizzy.co */ diff --git a/js/layout-mode.js b/js/layout-mode.js index 73fa9a9..eecb6af 100644 --- a/js/layout-mode.js +++ b/js/layout-mode.js @@ -12,7 +12,6 @@ function layoutModeDefinition( getSize, Outlayer ) { // link properties if ( isotope ) { this.options = isotope.options[ this.namespace ]; - this._getMeasurement = isotope._getMeasurement; this.element = isotope.element; this.items = isotope.filteredItems; this.size = isotope.size; @@ -63,6 +62,11 @@ function layoutModeDefinition( getSize, Outlayer ) { // ----- measurements ----- // + LayoutMode.prototype._getMeasurement = function() { + console.log('getting measurement', this.options.columnWidth ); + this.isotope._getMeasurement.apply( this, arguments ); + }; + LayoutMode.prototype.getColumnWidth = function() { this.getSegmentSize( 'column', 'Width' ); }; diff --git a/js/layout-modes/masonry.js b/js/layout-modes/masonry.js index fed4eb2..8b88d4e 100644 --- a/js/layout-modes/masonry.js +++ b/js/layout-modes/masonry.js @@ -28,6 +28,7 @@ function masonryDefinition( LayoutMode, Masonry ) { // save on to these methods var _getElementOffset = MasonryMode.prototype._getElementOffset; var layout = MasonryMode.prototype.layout; + var _getMeasurement = MasonryMode.prototype._getMeasurement; // sub-class Masonry extend( MasonryMode.prototype, Masonry.prototype ); @@ -35,6 +36,14 @@ function masonryDefinition( LayoutMode, Masonry ) { // set back, as it was overwritten by Masonry MasonryMode.prototype._getElementOffset = _getElementOffset; MasonryMode.prototype.layout = layout; + MasonryMode.prototype._getMeasurement = _getMeasurement; + + var measureColumns = MasonryMode.prototype.measureColumns; + MasonryMode.prototype.measureColumns = function() { + // set items, used if measuring first item + this.items = this.isotope.filteredItems; + measureColumns.call( this ); + }; return MasonryMode; } diff --git a/test/index.html b/test/index.html index 11ac564..1adc798 100644 --- a/test/index.html +++ b/test/index.html @@ -36,6 +36,7 @@ +
@@ -99,5 +100,14 @@ +