mirror of https://github.com/metafizzy/isotope
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.
74 lines
1.4 KiB
74 lines
1.4 KiB
10 years ago
|
test( 'arrangeComplete', function() {
|
||
11 years ago
|
|
||
|
'use strict';
|
||
|
|
||
10 years ago
|
var iso = new Isotope( '#arrange-complete', {
|
||
11 years ago
|
layoutMode: 'fitRows',
|
||
|
transitionDuration: '0.1s'
|
||
|
});
|
||
|
|
||
|
var tests = [
|
||
|
function() {
|
||
10 years ago
|
iso.once( 'arrangeComplete', function() {
|
||
|
ok( true, 'arrangeComplete after some were filtered' );
|
||
11 years ago
|
next();
|
||
|
});
|
||
|
|
||
11 years ago
|
iso.arrange({
|
||
11 years ago
|
filter: '.a1'
|
||
|
});
|
||
|
},
|
||
|
function() {
|
||
10 years ago
|
iso.once( 'arrangeComplete', function() {
|
||
11 years ago
|
ok( true, 'after some revealed, some hidden, some same' );
|
||
|
next();
|
||
|
});
|
||
|
|
||
11 years ago
|
iso.arrange({
|
||
11 years ago
|
filter: '.b2'
|
||
|
});
|
||
|
},
|
||
|
function() {
|
||
10 years ago
|
iso.once( 'arrangeComplete', function() {
|
||
11 years ago
|
ok( true, 'after random sort' );
|
||
|
next();
|
||
|
});
|
||
|
|
||
11 years ago
|
iso.arrange({
|
||
11 years ago
|
sortBy: 'random'
|
||
|
});
|
||
|
},
|
||
|
function() {
|
||
10 years ago
|
iso.once( 'arrangeComplete', function() {
|
||
11 years ago
|
ok( true, 'after layout mid-way thru transition' );
|
||
|
next();
|
||
|
});
|
||
|
|
||
11 years ago
|
iso.arrange({
|
||
11 years ago
|
filter: '.a2',
|
||
|
transitionDuration: '0.6s'
|
||
|
});
|
||
|
|
||
|
setTimeout( function() {
|
||
11 years ago
|
iso.arrange({
|
||
11 years ago
|
filter: '.b2'
|
||
|
});
|
||
|
}, 300 );
|
||
|
}
|
||
|
];
|
||
|
|
||
|
function next() {
|
||
|
if ( tests.length ) {
|
||
|
var nextTest = tests.shift();
|
||
10 years ago
|
// HACK for consecutive arrangeComplete calls
|
||
11 years ago
|
setTimeout( nextTest );
|
||
|
} else {
|
||
|
start();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
next();
|
||
|
stop();
|
||
|
|
||
|
});
|