layout-complete.js
1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
test( 'layoutComplete', function() {
'use strict';
var iso = new Isotope( '#layout-complete', {
layoutMode: 'fitRows',
transitionDuration: '0.1s'
});
var tests = [
function() {
iso.once( 'layoutComplete', function() {
ok( true, 'layoutComplete after some were filtered' );
next();
});
iso.arrange({
filter: '.a1'
});
},
function() {
iso.once( 'layoutComplete', function() {
ok( true, 'after some revealed, some hidden, some same' );
next();
});
iso.arrange({
filter: '.b2'
});
},
function() {
iso.once( 'layoutComplete', function() {
ok( true, 'after random sort' );
next();
});
iso.arrange({
sortBy: 'random'
});
},
function() {
iso.once( 'layoutComplete', 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 layoutComplete calls
setTimeout( nextTest );
} else {
start();
}
}
next();
stop();
});