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
d9d247a8a6f960720e449399984fa3be10134d61Eric Ferraiuolo combine: false,
d9d247a8a6f960720e449399984fa3be10134d61Eric Ferraiuolo filter: 'RAW'
d9d247a8a6f960720e449399984fa3be10134d61Eric Ferraiuolo }).use('app', 'app-transitions', function (Y) {
d9d247a8a6f960720e449399984fa3be10134d61Eric Ferraiuolo Y.HappyView = Y.Base.create('SadView', Y.View, [], {
d9d247a8a6f960720e449399984fa3be10134d61Eric Ferraiuolo render: function () {
d9d247a8a6f960720e449399984fa3be10134d61Eric Ferraiuolo this.get('container').setContent('<p>I\'m a happy view :)</p>');
d9d247a8a6f960720e449399984fa3be10134d61Eric Ferraiuolo Y.SadView = Y.Base.create('SadView', Y.View, [], {
d9d247a8a6f960720e449399984fa3be10134d61Eric Ferraiuolo render: function () {
d9d247a8a6f960720e449399984fa3be10134d61Eric Ferraiuolo this.get('container').setContent('<p>I\'m a sad view :(</p>');
d9d247a8a6f960720e449399984fa3be10134d61Eric Ferraiuolo var MyAppClass = Y.Base.create('MyApp', Y.App, [], {
d9d247a8a6f960720e449399984fa3be10134d61Eric Ferraiuolo myAppInstance = new MyAppClass({transitions: true}).render(),
d9d247a8a6f960720e449399984fa3be10134d61Eric Ferraiuolo transition = function (counter) {
d9d247a8a6f960720e449399984fa3be10134d61Eric Ferraiuolo counter = counter || 0;
d9d247a8a6f960720e449399984fa3be10134d61Eric Ferraiuolo if (counter >= 21) {
d9d247a8a6f960720e449399984fa3be10134d61Eric Ferraiuolo Y.later(100, null, function () {
d9d247a8a6f960720e449399984fa3be10134d61Eric Ferraiuolo myAppInstance.showView((counter % 2) ? 'happy' : 'sad');
d9d247a8a6f960720e449399984fa3be10134d61Eric Ferraiuolo transition(counter + 1);
d9d247a8a6f960720e449399984fa3be10134d61Eric Ferraiuolo transition();