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 _connectResults = []; // events connect result |
---|
4 | var backId = 'ti1back1'; |
---|
5 | var wrapperIdB = 'tst1WrapperB'; |
---|
6 | var MODULE = "TestInfo"; |
---|
7 | return { |
---|
8 | init: function(){ |
---|
9 | }, |
---|
10 | |
---|
11 | |
---|
12 | beforeActivate: function(){ |
---|
13 | // summary: |
---|
14 | // view life cycle beforeActivate() |
---|
15 | if(dom.byId(backId) && !has("phone")){ |
---|
16 | domStyle.set(dom.byId(backId), "visibility", "hidden"); // hide the back button in tablet mode |
---|
17 | } |
---|
18 | if(registry.byId("heading1")){ |
---|
19 | registry.byId("heading1").labelDivNode.innerHTML = "Test Information"; |
---|
20 | } |
---|
21 | |
---|
22 | if(dom.byId("tab1WrapperB") && !has("phone")){ |
---|
23 | domStyle.set(dom.byId("tab1WrapperB"), "visibility", "visible"); // show the nav view if it being used |
---|
24 | } |
---|
25 | domStyle.set(dom.byId(wrapperIdB), "visibility", "visible"); // show the view when it is ready |
---|
26 | }, |
---|
27 | |
---|
28 | afterActivate: function(){ |
---|
29 | // summary: |
---|
30 | // view life cycle afterActivate() |
---|
31 | if(!this.app.timedAutoFlow){ |
---|
32 | return; |
---|
33 | } |
---|
34 | this.app.loopCount++; |
---|
35 | //console.log(MODULE+" afterActivate this.app.loopCount="+this.app.loopCount); |
---|
36 | if(this.app.loopCount === 14){ |
---|
37 | console.log("TestInfo:afterActivate loopCount = 15 stop timer"); |
---|
38 | console.timeEnd("timing transition loop"); |
---|
39 | } |
---|
40 | }, |
---|
41 | |
---|
42 | |
---|
43 | destroy: function(){ |
---|
44 | var connectResult = _connectResults.pop(); |
---|
45 | while(connectResult){ |
---|
46 | connect.disconnect(connectResult); |
---|
47 | connectResult = _connectResults.pop(); |
---|
48 | } |
---|
49 | } |
---|
50 | }; |
---|
51 | }); |
---|