Browse Source

filtering working

pull/563/head
David DeSandro 11 years ago
parent
commit
37fc502ec4
  1. 2
      examples/basic.html
  2. 41
      isotope.js

2
examples/basic.html

@ -52,7 +52,7 @@
<script>
docReady( function() {
var container = document.querySelector('#basic');
var iso = new Isotope( container, {
var iso = window.iso = new Isotope( container, {
layoutMode: 'fitRows'
});
});

41
isotope.js

@ -46,20 +46,20 @@ function isotopeDefinition( Outlayer, getSize, matchesSelector ) {
};
Isotope.prototype.layout = function() {
// this.filteredItems = this._filter( this.items );
this.filteredItems = this._filter( this.items );
// this._sort();
Outlayer.prototype.layout.call( this );
// this._mode._resetLayout();
// this._resetLayout();
// this._manageStamps();
//
// // don't animate first layout
// var isInstant = this.options.isLayoutInstant !== undefined ?
// this.options.isLayoutInstant : !this._isLayoutInited;
// this.layoutItems( this.items, isInstant );
//
// // flag for initalized
// this._isLayoutInited = true;
// Outlayer.prototype.layout.call( this );
this._mode()._resetLayout();
this._resetLayout();
this._manageStamps();
// don't animate first layout
var isInstant = this.options.isLayoutInstant !== undefined ?
this.options.isLayoutInstant : !this._isLayoutInited;
this.layoutItems( this.filteredItems, isInstant );
// flag for initalized
this._isLayoutInited = true;
};
@ -67,6 +67,7 @@ function isotopeDefinition( Outlayer, getSize, matchesSelector ) {
Isotope.prototype._filter = function( items ) {
var filter = this.options.filter;
filter = filter || '*';
var matches = [];
var unmatches = [];
var hiddenMatched = [];
@ -111,13 +112,13 @@ function isotopeDefinition( Outlayer, getSize, matchesSelector ) {
// -------------------------- sort -------------------------- //
Isotope.prototype._sort = function() {
var sortBy = this.options.sortBy;
function sortFn( a, b ) {
}
this.filteredItems.sort( );
};
// Isotope.prototype._sort = function() {
// var sortBy = this.options.sortBy;
// function sortFn( a, b ) {
//
// }
// this.filteredItems.sort( );
// };
// -------------------------- methods -------------------------- //

Loading…
Cancel
Save