Browse Source

Add _positionItem in facadeMethods

pull/865/head
Thiago Lagden 10 years ago
parent
commit
0c1742d5e3
  1. 103
      dist/isotope.pkgd.js
  2. 4
      dist/isotope.pkgd.min.js
  3. 4
      js/isotope.js
  4. 1
      js/layout-mode.js

103
dist/isotope.pkgd.js vendored

@ -145,7 +145,7 @@ if ( typeof define === 'function' && define.amd ) {
})( window );
/*!
* eventie v1.0.5
* eventie v1.0.6
* event binding helper
* eventie.bind( elem, 'click', myFn )
* eventie.unbind( elem, 'click', myFn )
@ -225,7 +225,7 @@ if ( typeof define === 'function' && define.amd ) {
window.eventie = eventie;
}
})( this );
})( window );
/*!
* docReady v1.0.4
@ -309,13 +309,13 @@ if ( typeof define === 'function' && define.amd ) {
})( window );
/*!
* EventEmitter v4.2.9 - git.io/ee
* Oliver Caldwell
* MIT license
* EventEmitter v4.2.11 - git.io/ee
* Unlicense - http://unlicense.org/
* Oliver Caldwell - http://oli.me.uk/
* @preserve
*/
(function () {
;(function () {
/**
@ -2856,6 +2856,7 @@ function layoutModeDefinition( getSize, Outlayer ) {
'_manageStamp',
'_getContainerSize',
'_getElementOffset',
'_positionItem',
'needsResizeLayout'
];
@ -2989,7 +2990,7 @@ if ( typeof define === 'function' && define.amd ) {
})( window );
/*!
* Masonry v3.2.1
* Masonry v3.2.2
* Cascading grid layout library
* http://masonry.desandro.com
* MIT License
@ -3184,7 +3185,8 @@ if ( typeof define === 'function' && define.amd ) {
'get-size/get-size'
],
masonryDefinition );
} else if (typeof exports === 'object') {
} else if ( typeof exports === 'object' ) {
// CommonJS
module.exports = masonryDefinition(
require('outlayer'),
require('get-size')
@ -3577,7 +3579,23 @@ function isotopeDefinition( Outlayer, getSize, matchesSelector, Item, LayoutMode
this.option( opts );
this._getIsInstant();
// filter, sort, and layout
this.filteredItems = this._filter( this.items );
// filter
var filtered = this._filter( this.items );
this.filteredItems = filtered.matches;
var _this = this;
function hideReveal() {
_this.reveal( filtered.needReveal );
_this.hide( filtered.needHide );
}
if ( this._isInstant ) {
this._noTransition( hideReveal );
} else {
hideReveal();
}
this._sort();
this._layout();
};
@ -3626,19 +3644,12 @@ function isotopeDefinition( Outlayer, getSize, matchesSelector, Item, LayoutMode
}
}
var _this = this;
function hideReveal() {
_this.reveal( hiddenMatched );
_this.hide( visibleUnmatched );
}
if ( this._isInstant ) {
this._noTransition( hideReveal );
} else {
hideReveal();
}
return matches;
// return collections of items to be manipulated
return {
matches: matches,
needReveal: hiddenMatched,
needHide: visibleUnmatched
};
};
// get a jQuery, function, or a matchesSelector test given the filter
@ -3844,6 +3855,10 @@ function isotopeDefinition( Outlayer, getSize, matchesSelector, Item, LayoutMode
return this._mode()._getContainerSize();
};
Isotope.prototype._positionItem = function(item, x, y, isInstant) {
return this._mode()._positionItem(item, x, y, isInstant);
};
Isotope.prototype.needsResizeLayout = function() {
return this._mode().needsResizeLayout();
};
@ -3856,6 +3871,7 @@ function isotopeDefinition( Outlayer, getSize, matchesSelector, Item, LayoutMode
if ( !items.length ) {
return;
}
// filter, layout, reveal new items
var filteredItems = this._filterRevealAdded( items );
// add to filteredItems
this.filteredItems = this.filteredItems.concat( filteredItems );
@ -3867,28 +3883,26 @@ function isotopeDefinition( Outlayer, getSize, matchesSelector, Item, LayoutMode
if ( !items.length ) {
return;
}
// add items to beginning of collection
var previousItems = this.items.slice(0);
this.items = items.concat( previousItems );
// start new layout
this._resetLayout();
this._manageStamps();
// layout new stuff without transition
// filter, layout, reveal new items
var filteredItems = this._filterRevealAdded( items );
// layout previous items
this.layoutItems( previousItems );
// add to filteredItems
this.layoutItems( this.filteredItems );
// add to items and filteredItems
this.filteredItems = filteredItems.concat( this.filteredItems );
this.items = items.concat( this.items );
};
Isotope.prototype._filterRevealAdded = function( items ) {
var filteredItems = this._noTransition( function() {
return this._filter( items );
});
// layout and reveal just the new items
this.layoutItems( filteredItems, true );
this.reveal( filteredItems );
return items;
var filtered = this._filter( items );
this.hide( filtered.needHide );
// reveal all new items
this.reveal( filtered.matches );
// layout new items, no transition
this.layoutItems( filtered.matches, true );
return filtered.matches;
};
/**
@ -3908,24 +3922,7 @@ function isotopeDefinition( Outlayer, getSize, matchesSelector, Item, LayoutMode
this.element.appendChild( item.element );
}
// filter new stuff
/*
// this way adds hides new filtered items with NO transition
// so user can't see if new hidden items have been inserted
var filteredInsertItems;
this._noTransition( function() {
filteredInsertItems = this._filter( items );
// hide all new items
this.hide( filteredInsertItems );
});
// */
// this way hides new filtered items with transition
// so user at least sees that something has been added
var filteredInsertItems = this._filter( items );
// hide all newitems
this._noTransition( function() {
this.hide( filteredInsertItems );
});
// */
var filteredInsertItems = this._filter( items ).matches;
// set flag
for ( i=0; i < len; i++ ) {
items[i].isLayoutInstant = true;

4
dist/isotope.pkgd.min.js vendored

File diff suppressed because one or more lines are too long

4
js/isotope.js

@ -453,6 +453,10 @@ function isotopeDefinition( Outlayer, getSize, matchesSelector, Item, LayoutMode
return this._mode()._getContainerSize();
};
Isotope.prototype._positionItem = function(item, x, y, isInstant) {
return this._mode()._positionItem(item, x, y, isInstant);
};
Isotope.prototype.needsResizeLayout = function() {
return this._mode().needsResizeLayout();
};

1
js/layout-mode.js

@ -29,6 +29,7 @@ function layoutModeDefinition( getSize, Outlayer ) {
'_manageStamp',
'_getContainerSize',
'_getElementOffset',
'_positionItem',
'needsResizeLayout'
];

Loading…
Cancel
Save