1 | define(["dojo/dom", "dojo/dom-style", "dojo/_base/connect", "dojo/_base/lang","dijit/registry", "dojox/mvc/at", "dojox/mobile/TransitionEvent", |
---|
2 | "dojox/mvc/Repeat", "dojox/mvc/getStateful", "dojox/mvc/Output", "dojo/sniff"], |
---|
3 | function(dom, domStyle, connect, lang, registry, at, TransitionEvent, Repeat, getStateful, Output, has){ |
---|
4 | var _connectResults = []; // events connect result |
---|
5 | |
---|
6 | // these ids are updated here and in the html file to avoid duplicate ids |
---|
7 | var backId = 'ti1back1'; |
---|
8 | var wrapperIdA = 'tst1WrapperA'; |
---|
9 | var wrapperIdB = 'tst1WrapperB'; |
---|
10 | |
---|
11 | |
---|
12 | return { |
---|
13 | // repeat view init |
---|
14 | init: function(){ |
---|
15 | }, |
---|
16 | |
---|
17 | |
---|
18 | beforeActivate: function(){ |
---|
19 | // summary: |
---|
20 | // view life cycle beforeActivate() |
---|
21 | if(dom.byId(backId) && !has("phone")){ |
---|
22 | domStyle.set(dom.byId(backId), "visibility", "hidden"); // hide the back button in tablet mode |
---|
23 | } |
---|
24 | if(dom.byId("tab1WrapperA") && !has("phone")){ |
---|
25 | domStyle.set(dom.byId("tab1WrapperA"), "visibility", "visible"); // show the nav view if it being used |
---|
26 | domStyle.set(dom.byId("tab1WrapperB"), "visibility", "visible"); // show the nav view if it being used |
---|
27 | } |
---|
28 | domStyle.set(dom.byId(wrapperIdA), "visibility", "visible"); // show the view when it is ready |
---|
29 | domStyle.set(dom.byId(wrapperIdB), "visibility", "visible"); // show the view when it is ready |
---|
30 | }, |
---|
31 | |
---|
32 | afterActivate: function(){ |
---|
33 | // summary: |
---|
34 | // view life cycle afterActivate() |
---|
35 | }, |
---|
36 | |
---|
37 | |
---|
38 | destroy: function(){ |
---|
39 | var connectResult = _connectResults.pop(); |
---|
40 | while(connectResult){ |
---|
41 | connect.disconnect(connectResult); |
---|
42 | connectResult = _connectResults.pop(); |
---|
43 | } |
---|
44 | } |
---|
45 | }; |
---|
46 | }); |
---|