Filter & sort magical layouts http://isotope.metafizzy.co
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
648 B

test( 'getSortData', function() {
'use strict';
var iso = new Isotope( '#get-sort-data', {
layoutMode: 'fitRows',
getSortData: {
ninjaTurtle: '[data-ninja-turtle]',
fruit: 'span.fruit',
b: 'b parseFloat',
i: 'i parseInt',
bbroke: 'b foobar'
}
});
var item = iso.items[0];
equal( item.sortData.ninjaTurtle, 'leonardo', '[data-attr] shorthand' );
equal( item.sortData.fruit, 'watermelon', 'query selector shorthand' );
equal( item.sortData.b, 3.14, 'parseFloat parser' );
equal( item.sortData.i, 42, 'parseInt parser' );
equal( item.sortData.bbroke, '3.14', 'default nonparser' );
});