Browse Source

use needsResizeLayout in Outlayer v1.2

pull/726/head
David DeSandro 11 years ago
parent
commit
9b845ca629
  1. 4
      bower.json
  2. 4
      js/isotope.js
  3. 10
      js/layout-mode.js

4
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",

4
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 -------------------------- //

10
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 ----- //

Loading…
Cancel
Save