Merge pull request #32755 from SPWizard01/master

[isotope-layout] filtering function passes an argument of an item being filtered
This commit is contained in:
Armando Aguirre
2019-02-04 17:15:01 -08:00
committed by GitHub
2 changed files with 4 additions and 3 deletions
+2 -1
View File
@@ -2,6 +2,7 @@
// Project: http://isotope.metafizzy.co/
// Definitions by: Anže Videnič <https://github.com/avidenic>
// Mălin Brândușe <https://github.com/malinushj>
// SPWizard01 <https://github.com/SPWizard01>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
@@ -30,7 +31,7 @@ declare namespace Isotope {
* If set to a string, that value is used as a selector.
* If filter is set to a function, that function checks each item and returns true or false if the item should be shown or hidden.
*/
filter?: string | (() => boolean);
filter?: string | ((itemElement: HTMLElement) => boolean);
/**
* Items are arranged into rows. Rows progress vertically. Similar to what you would expect from a layout that uses CSS floats. fitRows works well for items that have the same height.
*/
+2 -2
View File
@@ -70,8 +70,8 @@ let $grid = $('.grid').isotope({
// test the ones not used in upper test
$grid = $('.grid').isotope({
filter: (): boolean => {
return true;
filter: (itemElem): boolean => {
return itemElem ? true : false;
},
sortAscending: {
key: true