Debian Codegraph @

dojox/app/tests/mediaQuery3ColumnApp/views/main/main.js

raw symbols SCIP
1 define(["dojo/_base/lang", "dojo/dom-class"],
2 function(lang, domClass){
3
4 return {
5 // view init
6 init: function(){
7 console.log("in init for view with this.name = "+this.name);
8
9 // handle the backButton click
10 this.mainheaderBackButton.on("click", lang.hitch(this, function(e){
11 if(history){
12 history.back();
13 }else{
14 this.app.emit("MQ3ColApp/BackFromMain", e);
15 }
16 }));
17
18 // This code will setup the view to work in the left or center depending upon the view name
19 if(this.name == "mainLeft"){ // app was changed to stop using mainLeft for now.
20 this.mainOuterContainer["data-app-constraint"] = "left";
21 domClass.add(this.mainheaderBackButton.domNode, "showOnMedium");
22 domClass.add(this.mainOuterContainer, "left");
23 domClass.add(this.mainOuterDiv, "navPane hideOnSmall"); // for main on left
24 }else{
25 this.mainOuterContainer["data-app-constraint"] = "center";
26 domClass.add(this.mainheaderBackButton.domNode, "showOnSmall hideOnMedium hideOnLarge");
27 domClass.add(this.mainOuterContainer, "center");
28 }
29
30
31 },
32
33 beforeActivate: function(previousView, data){
34 // summary:
35 // view life cycle beforeActivate()
36 //
37 this.previousView = previousView;
38
39 // Set the selection from the params
40 if(this.params["mainSel"]){
41 if(this.mainH2){
42 this.mainH2.set("label",this.params["mainSel"]+" selected");
43 }else{
44 console.error("Problem this.mainH2 should not be null ");
45 }
46 }else{
47 this.mainH2.set("label","None selected");
48 }
49 },
50
51 beforeDeactivate: function(){
52 // summary:
53 // view life cycle beforeActivate()
54 //
55 },
56
57 lastOption1Clicked: function(/*Event*/ e){
58 this.app.emit("MQ3ColApp/LastOption1", e);
59 },
60
61 lastOption2Clicked: function(/*Event*/ e){
62 this.app.emit("MQ3ColApp/LastOption2", e);
63 },
64
65 lastOption3Clicked: function(/*Event*/ e){
66 this.app.emit("MQ3ColApp/LastOption3", e);
67 },
68
69 // view destroy, this destroy function can be removed since it is empty
70 destroy: function(){
71 // _WidgetBase.on listener is automatically destroyed when the Widget itself is.
72 }
73 };
74 });