Debian Codegraph @

dojox/app/tests/mediaQuery3ColumnApp/views/last/last.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.lastheaderBackButton.on("click", lang.hitch(this, function(e){
11 if(history){
12 history.back();
13 }else{
14 this.app.emit("MQ3ColApp/BackFromLast", e);
15 }
16 }));
17
18 // This code will setup the view to work in the center or the right depending upon the viewName
19 if(this.name == "lastCenter"){
20 this.lastOuterContainer["data-app-constraint"] = "center";
21 domClass.add(this.lastheaderBackButton.domNode, "showOnMedium hideOnLarge showOnSmall");
22 domClass.add(this.lastOuterContainer, "center");
23 }else{
24 this.lastOuterContainer["data-app-constraint"] = "right";
25 domClass.add(this.lastheaderBackButton.domNode, "showOnSmall hideOnMedium hideOnLarge");
26 domClass.add(this.lastOuterDiv, "navPane hideOnMedium");
27 domClass.add(this.lastOuterContainer, "hideOnMedium right");
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["lastSel"]){
41 this.lastH2.set("label",this.params["lastSel"]+" selected");
42 }else{
43 this.lastH2.set("label","None selected");
44 }
45 },
46
47 beforeDeactivate: function(){
48 // summary:
49 // view life cycle beforeActivate()
50 //
51 },
52
53 lastOption1Clicked: function(/*Event*/ e){
54 this.app.emit("MQ3ColApp/LastOption1", e);
55 },
56
57 lastOption2Clicked: function(/*Event*/ e){
58 this.app.emit("MQ3ColApp/LastOption2", e);
59 },
60
61 lastOption3Clicked: function(/*Event*/ e){
62 this.app.emit("MQ3ColApp/LastOption3", e);
63 },
64
65 // view destroy, this destroy function can be removed since it is empty
66 destroy: function(){
67 // _WidgetBase.on listener is automatically destroyed when the Widget itself is.
68 }
69 };
70 });