Browse Source

Dispatch an event with all the filtered Items

pull/1378/head
Faison Zutavern 7 years ago
parent
commit
ab20d547d0
  1. 11
      dist/isotope.pkgd.js
  2. 10
      js/isotope.js

11
dist/isotope.pkgd.js vendored

@ -3177,6 +3177,7 @@ var trim = String.prototype.trim ?
var matches = []; var matches = [];
var hiddenMatched = []; var hiddenMatched = [];
var visibleUnmatched = []; var visibleUnmatched = [];
var results;
var test = this._getFilterTest( filter ); var test = this._getFilterTest( filter );
@ -3201,12 +3202,17 @@ var trim = String.prototype.trim ?
} }
} }
// return collections of items to be manipulated results = {
return {
matches: matches, matches: matches,
needReveal: hiddenMatched, needReveal: hiddenMatched,
needHide: visibleUnmatched needHide: visibleUnmatched
}; };
// allow the filtered items to be modified
this.dispatchEvent( 'itemsFiltered', null, [ results ] );
// return collections of items to be manipulated
return results;
}; };
// get a jQuery, function, or a matchesSelector test given the filter // get a jQuery, function, or a matchesSelector test given the filter
@ -3558,4 +3564,3 @@ var trim = String.prototype.trim ?
return Isotope; return Isotope;
})); }));

10
js/isotope.js

@ -238,6 +238,7 @@ var trim = String.prototype.trim ?
var matches = []; var matches = [];
var hiddenMatched = []; var hiddenMatched = [];
var visibleUnmatched = []; var visibleUnmatched = [];
var results;
var test = this._getFilterTest( filter ); var test = this._getFilterTest( filter );
@ -262,12 +263,17 @@ var trim = String.prototype.trim ?
} }
} }
// return collections of items to be manipulated results = {
return {
matches: matches, matches: matches,
needReveal: hiddenMatched, needReveal: hiddenMatched,
needHide: visibleUnmatched needHide: visibleUnmatched
}; };
// allow the filtered items to be modified
this.dispatchEvent( 'itemsFiltered', null, [ results ] );
// return collections of items to be manipulated
return results;
}; };
// get a jQuery, function, or a matchesSelector test given the filter // get a jQuery, function, or a matchesSelector test given the filter

Loading…
Cancel
Save