From 9b845ca629d5a825bdba8cc44a151e8ade063411 Mon Sep 17 00:00:00 2001 From: David DeSandro Date: Wed, 5 Mar 2014 22:27:57 -0500 Subject: [PATCH] use needsResizeLayout in Outlayer v1.2 --- bower.json | 4 ++-- js/isotope.js | 4 ++-- js/layout-mode.js | 10 +++------- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/bower.json b/bower.json index 464270c..a2c3b7f 100644 --- a/bower.json +++ b/bower.json @@ -13,8 +13,8 @@ "dependencies": { "get-size": "desandro/get-size#>=1 <2", "matches-selector": "desandro/matches-selector#>=1 <2", - "outlayer": ">=1.1.10 <2", - "masonry": ">=3.1 <4" + "outlayer": "v1.2", + "masonry": "3.1.x" }, "devDependencies": { "doc-ready": "desandro/doc-ready", diff --git a/js/isotope.js b/js/isotope.js index a46b123..1e18661 100644 --- a/js/isotope.js +++ b/js/isotope.js @@ -436,8 +436,8 @@ function isotopeDefinition( Outlayer, getSize, matchesSelector, Item, LayoutMode return this._mode()._getContainerSize(); }; - Isotope.prototype.resize = function() { - this._mode().resize(); + Isotope.prototype.needsResizeLayout = function() { + return this._mode().needsResizeLayout(); }; // -------------------------- adding & removing -------------------------- // diff --git a/js/layout-mode.js b/js/layout-mode.js index 77b5508..1b96da6 100644 --- a/js/layout-mode.js +++ b/js/layout-mode.js @@ -29,7 +29,7 @@ function layoutModeDefinition( getSize, Outlayer ) { '_manageStamp', '_getContainerSize', '_getElementOffset', - 'resize' + 'needsResizeLayout' ]; for ( var i=0, len = facadeMethods.length; i < len; i++ ) { @@ -47,17 +47,13 @@ function layoutModeDefinition( getSize, Outlayer ) { // ----- ----- // // for horizontal layout modes, check vertical size - LayoutMode.prototype.resizeVertical = function() { + LayoutMode.prototype.needsVerticalResizeLayout = function() { // don't trigger if size did not change var size = getSize( this.isotope.element ); // check that this.size and size are there // IE8 triggers resize on body size change, so they might not be var hasSizes = this.isotope.size && size; - if ( hasSizes && size.innerHeight === this.isotope.size.innerHeight ) { - return; - } - - this.isotope.layout(); + return hasSizes && size.innerHeight !== this.isotope.size.innerHeight; }; // ----- measurements ----- //