1 | define(["dojo/dom", "dojo/dom-style", "dojo/_base/connect","dijit/registry", "dojo/sniff", "dojox/mobile/TransitionEvent"], |
---|
2 | function(dom, domStyle, connect, registry, has, TransitionEvent){ |
---|
3 | var app = null; |
---|
4 | var MODULE = "P1"; |
---|
5 | return { |
---|
6 | init: function(){ |
---|
7 | app = this.app; |
---|
8 | }, |
---|
9 | |
---|
10 | beforeActivate: function(){ |
---|
11 | // summary: |
---|
12 | // view life cycle beforeActivate() |
---|
13 | //console.log(MODULE+" beforeActivate"); |
---|
14 | }, |
---|
15 | |
---|
16 | afterActivate: function(){ |
---|
17 | // summary: |
---|
18 | // view life cycle afterActivate() |
---|
19 | //console.log(MODULE+" afterActivate"); |
---|
20 | /* |
---|
21 | //loop test |
---|
22 | if(this.app.loopCount++ < ){ |
---|
23 | if(history){ |
---|
24 | history.back(); |
---|
25 | } |
---|
26 | }else{ |
---|
27 | // console.time("timing transition loop"); |
---|
28 | console.timeEnd("timing transition loop"); |
---|
29 | } |
---|
30 | */ |
---|
31 | if(!this.app.timedAutoFlow && !this.app.timed100Loops){ |
---|
32 | return; |
---|
33 | } |
---|
34 | this.app.loopCount++; |
---|
35 | //console.log(MODULE+" afterActivate this.app.loopCount="+this.app.loopCount); |
---|
36 | var liWidget = null; |
---|
37 | if(this.app.timed100Loops){ |
---|
38 | if(this.app.loopCount < 100) { |
---|
39 | if(history){ |
---|
40 | history.back(); |
---|
41 | } |
---|
42 | }else{ |
---|
43 | console.log("P1:afterActivate loopCount = 100 stop timer"); |
---|
44 | console.timeEnd("timing transition loop"); |
---|
45 | } |
---|
46 | return; |
---|
47 | } |
---|
48 | |
---|
49 | if(this.app.loopCount === 4){ |
---|
50 | liWidget = registry.byId("dojox_mobile_ListItem_0"); //P1,S1,V1 |
---|
51 | }else if(this.app.loopCount === 5) { |
---|
52 | liWidget = registry.byId("dojox_mobile_ListItem_2"); //P1,S1,V3 |
---|
53 | }else if(this.app.loopCount === 6) { |
---|
54 | liWidget = registry.byId("dojox_mobile_ListItem_1"); //V2 |
---|
55 | }else if(this.app.loopCount === 8) { |
---|
56 | liWidget = registry.byId("dojox_mobile_ListItem_7"); //P2,S2,Ss2,V5 |
---|
57 | }else if(this.app.loopCount === 11) { |
---|
58 | // liWidget = registry.byId("dojox_mobile_ListItem_6"); //P2,S2,Ss2,V5+P2,S2,Ss2,V6 |
---|
59 | liWidget = registry.byId("dojox_mobile_ListItem_3"); //P1,S1,V8 |
---|
60 | }else if(this.app.loopCount === 12) { |
---|
61 | liWidget = registry.byId("dojox_mobile_ListItem_4"); //-P1,S1,V8 |
---|
62 | // var liWidget2 = registry.byId("dojox_mobile_ListItem_4"); //-P1,S1,V8 |
---|
63 | // setTimeout(function() { |
---|
64 | // if(liWidget2){ |
---|
65 | // var ev = new TransitionEvent(liWidget2.domNode, liWidget2.params); |
---|
66 | // // ev.dispatch(); |
---|
67 | // } |
---|
68 | // }, 500); |
---|
69 | }else if(this.app.loopCount === 13) { |
---|
70 | liWidget = registry.byId("dojox_mobile_ListItem_6"); //P2,S2,Ss2,V5+P2,S2,Ss2,V6 |
---|
71 | } |
---|
72 | if(liWidget){ |
---|
73 | var ev = new TransitionEvent(liWidget.domNode, liWidget.params); |
---|
74 | ev.dispatch(); |
---|
75 | } |
---|
76 | }, |
---|
77 | beforeDeactivate: function(){ |
---|
78 | //console.log(MODULE+" beforeDeactivate"); |
---|
79 | }, |
---|
80 | afterDeactivate: function(){ |
---|
81 | //console.log(MODULE+" afterDeactivate"); |
---|
82 | } |
---|
83 | }; |
---|
84 | }); |
---|