1 | define(["dojo/dom", "dojo/dom-style", "dojo/_base/connect", "dojox/mobile/TransitionEvent"], |
---|
2 | function(dom, domStyle, connect, TransitionEvent){ |
---|
3 | var _connectResults = []; // events connect result |
---|
4 | |
---|
5 | return { |
---|
6 | // view init |
---|
7 | init: function(){ |
---|
8 | }, |
---|
9 | |
---|
10 | beforeActivate: function(){ |
---|
11 | // summary: |
---|
12 | // view life cycle beforeActivate() |
---|
13 | |
---|
14 | var connectResult; |
---|
15 | |
---|
16 | var backButtomDom = dom.byId('headerBackButton'); |
---|
17 | connectResult = connect.connect(backButtomDom, "onclick", function(e){ |
---|
18 | |
---|
19 | var transOpts = { |
---|
20 | title:'header+navigation+centerNavigation', |
---|
21 | target:'header+navigation+centerNavigation', |
---|
22 | url:'#header+navigation+centerNavigation' |
---|
23 | }; |
---|
24 | new TransitionEvent(e.target, transOpts, e).dispatch(); |
---|
25 | |
---|
26 | }); |
---|
27 | _connectResults.push(connectResult); |
---|
28 | |
---|
29 | }, |
---|
30 | |
---|
31 | |
---|
32 | afterDeactivate: function(){ |
---|
33 | // summary: |
---|
34 | // view life cycle beforeActivate() |
---|
35 | // |
---|
36 | var connectResult = _connectResults.pop(); |
---|
37 | while(connectResult){ |
---|
38 | connect.disconnect(connectResult); |
---|
39 | connectResult = _connectResults.pop(); |
---|
40 | } |
---|
41 | }, |
---|
42 | |
---|
43 | // view destroy |
---|
44 | destroy: function(){ |
---|
45 | var connectResult = _connectResults.pop(); |
---|
46 | while(connectResult){ |
---|
47 | connect.disconnect(connectResult); |
---|
48 | connectResult = _connectResults.pop(); |
---|
49 | } |
---|
50 | } |
---|
51 | }; |
---|
52 | }); |
---|