-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathViewManager.js
58 lines (49 loc) · 1.57 KB
/
ViewManager.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
class ViewManager {
constructor() {
this.views = [];
}
addView(id, type) {
var view = {"id":id, "type":type};
console.log()
this.views.push(view);
}
addElementRnrInfo(el) {
// console.log("view manger add element ", el);
for (var i = 0; i < this.views.length; ++i)
{
var vi = this.views[i];
var controller = sap.ui.getCore().byId(vi.id).getController();
controller.drawExtra(el);
}
}
replace(oldEl, newEl) {
// console.log("viewManager old ", oldEl);
console.log("viewManager new", newEl);
for (var i = 0; i < this.views.length; ++i)
{
var vt = this.views[i].type;
newEl[vt] = oldEl[vt];
var c = sap.ui.getCore().byId(this.views[i].id).getController();
c.replaceElement(oldEl, newEl);
}
}
setGeometry(arg)
{
console.log("view manager geometry ", arg);
for (var i = 0; i < this.views.length; ++i)
{
var controller = sap.ui.getCore().byId(this.views[i].id).getController();
var type = this.views[i].type;
console.log("geo ", type, arg[type] );
controller.geometry(arg[type][0]);
}
}
envokeViewFunc(func, arg) {
// console.log("viewmanager envoke func ", func,
for (var i = 0; i < this.views.length; ++i)
{
var c = sap.ui.getCore().byId(this.views[i].id).getController();
c[func](arg);
}
}
}