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.
 
 
 

73 lines
1.4 KiB

test( 'arrangeComplete', function() {
'use strict';
var iso = new Isotope( '#arrange-complete', {
layoutMode: 'fitRows',
transitionDuration: '0.1s'
});
var tests = [
function() {
iso.once( 'arrangeComplete', function() {
ok( true, 'arrangeComplete after some were filtered' );
next();
});
iso.arrange({
filter: '.a1'
});
},
function() {
iso.once( 'arrangeComplete', function() {
ok( true, 'after some revealed, some hidden, some same' );
next();
});
iso.arrange({
filter: '.b2'
});
},
function() {
iso.once( 'arrangeComplete', function() {
ok( true, 'after random sort' );
next();
});
iso.arrange({
sortBy: 'random'
});
},
function() {
iso.once( 'arrangeComplete', function() {
ok( true, 'after layout mid-way thru transition' );
next();
});
iso.arrange({
filter: '.a2',
transitionDuration: '0.6s'
});
setTimeout( function() {
iso.arrange({
filter: '.b2'
});
}, 300 );
}
];
function next() {
if ( tests.length ) {
var nextTest = tests.shift();
// HACK for consecutive arrangeComplete calls
setTimeout( nextTest );
} else {
start();
}
}
next();
stop();
});