-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApplication.js
executable file
·76 lines (38 loc) · 1.48 KB
/
Application.js
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
(function(){
up.Application = Application;
function Application(_idRootDiv){
this.rootDiv = document.getElementById(_idRootDiv);
this.viewControllers = new Array();
this.language = "en";
this.strings = {};
var that = this;
//this.minWidth = 1024;
//this.minHeight = 768;
window.onresize = function(event){
//if(window.outerWidth <= that.minWidth || window.outerHeight <= that.minHeight) return;
for(var i in that.viewControllers){
that.viewControllers[i].view.doLayout();
}
}
}//constructor
Application.prototype.start = function(){
}//start
Application.prototype.loadStringsAndStart = function(){
this.start();
}//loadStringsAndStart
Application.prototype.addViewController = function(_viewController){
this.rootDiv.appendChild(_viewController.view.html);
_viewController.onAppendView();
this.viewControllers.push(_viewController);
}//addViewController
Application.prototype.removeViewController = function(_viewController){
this.rootDiv.removeChild(_viewController.view.html);
_viewController.onRemoveView();
var index = this.viewControllers.indexOf(_viewController);
this.viewControllers.splice(index,1);
}//removeViewController
Application.prototype.replaceViewController = function(_oldViewController, _newViewController){
this.removeViewController(_oldViewController);
this.addViewController(_newViewController);
}//replaceViewController
})();