Browse Source

filtering working

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

2
examples/basic.html

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

41
isotope.js

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

Loading…
Cancel
Save