-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestcontroller.js
More file actions
100 lines (76 loc) · 2.52 KB
/
testcontroller.js
File metadata and controls
100 lines (76 loc) · 2.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/**
* This is the description for routing all the session actions. It means url= #/session/*
*
* @class TestController
* @constructor
*/
function TestController() {
this.init();
}
TestController.prototype.loadNavigationPanel = ExiController.prototype.loadNavigationPanel;
TestController.prototype.setPageBackground = function() {
};
TestController.prototype.notFound = function() {
};
/**
* Inits the controller for the session related objects
* Paths accepted:
* #/session/nav
* #/session/nav/:sessionId/session
*
* @method init
*/
TestController.prototype.init = function() {
var _this = this;
var listView;
function setPageBackground() {
_this.setPageBackground();
}
function notFound() {
_this.notFound();
}
Path.map("#/navigation").to(function() {
EXI.clearNavigationPanel();
EXI.hideNavigationPanel();
/** Creates an instance of a Test Panel **/
var myWidget = new TestListView();
/** Add panel to the left navigation panel **/
EXI.addNavigationPanel(myWidget);
EXI.setLoadingNavigationPanel("Loading my data");
/** Loads data into the panel **/
myWidget.load([
{ 'name': 'Lisa', "email":"[email protected]", "phone":"555-111-1224" },
{ 'name': 'Bart', "email":"[email protected]", "phone":"555-222-1234" },
{ 'name': 'Homer', "email":"[email protected]", "phone":"555-222-1244" },
{ 'name': 'Marge', "email":"[email protected]", "phone":"555-222-1254" }
]);
myWidget.onSelect.attach(function(sender, selected) {
location.hash = "/" + selected[0].name + "/main";
});
EXI.setLoadingNavigationPanel(false);
}).enter(this.setPageBackground);
Path.map("#/main").to(function() {
var mainView = new TestMainView(this.params['crystalId']);
EXI.addMainPanel(mainView);
mainView.load(this.params['crystalId']);
}).enter(this.setPageBackground);
Path.map("#/:name/main").to(function() {
var name = this.params['name'];
var mainView = new TestMainView();
EXI.addMainPanel(mainView);
mainView.load( name);
}).enter(this.setPageBackground);
Path.map("#/navigation/clear").to(function() {
EXI.clearNavigationPanel();
}).enter(this.setPageBackground);
Path.map("#/main/clear").to(function() {
EXI.clearMainPanel();
}).enter(this.setPageBackground);
Path.map("#/main/setloading").to(function() {
EXI.setLoadingMainPanel("I am busy now");
}).enter(this.setPageBackground);
Path.map("#/main/removeloading").to(function() {
EXI.setLoadingMainPanel(false);
}).enter(this.setPageBackground);
Path.rescue(this.notFound);
};