-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRootApp.controller.js
More file actions
107 lines (107 loc) · 3.69 KB
/
RootApp.controller.js
File metadata and controls
107 lines (107 loc) · 3.69 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
99
100
101
102
103
104
105
106
107
sap.ui.define([
"sap/ui/core/mvc/Controller",
], function (Controller) {
"use strict";
var base;
return Controller.extend("BNetSapUI5.RootApp", {
onInit: function () {
base = this;
base.getView().setModel(oModel);
base.getColors();
base.getFontAwesomeIcons();
base.getSimpleLineIcons();
base.getFontIcons();
},
getColors: function () {
var colorTypes = [
{
"ColorKey": "Red",
"ColorName": "Red",
"ColorDescription": "Primary Colors"
}, {
"ColorKey": "Green",
"ColorName": "Green",
"ColorDescription": "Primary Colors"
}, {
"ColorKey": "Blue",
"ColorName": "Blue",
"ColorDescription": "Primary Colors"
}, {
"ColorKey": "Yellow",
"ColorName": "Yellow",
"ColorDescription": "Primary Colors"
},
]
oModel.setProperty("/ColorCollection", colorTypes);
ColorLibrary.getColors(function (allColors) {
oModel.setProperty("/ColorList", allColors);
oModel.setProperty("/ColorListCount", allColors.length);
});
},
getFontAwesomeIcons: function () {
oModel.setProperty("/FontAwesomeIconList", []);
FontAwesomeIcons.getIcons(function (allIcons) {
oModel.setProperty("/IconListCount", allIcons.length);
allIcons.map(function (icon) {
if (icon.unicode && icon.brand === "regular") {
sap.ui.core.IconPool.addIcon(icon.name, "fontawesome-regular", "fontawesome-regular", icon.unicode);
oModel.getProperty("/FontAwesomeIconList").push({
"src": "sap-icon://fontawesome-regular/" + icon.name,
"name": icon.name,
"unicode": icon.unicode
});
}
else if (icon.unicode && icon.brand === "brands") {
sap.ui.core.IconPool.addIcon(icon.name, "fontawesome-brands", "fontawesome-brands", icon.unicode);
oModel.getProperty("/FontAwesomeIconList").push({
"src": "sap-icon://fontawesome-brands/" + icon.name,
"name": icon.name,
"unicode": icon.unicode
});
}
else {
sap.ui.core.IconPool.addIcon(icon.name, "fontawesome-solid", "fontawesome-solid", icon.unicode);
oModel.getProperty("/FontAwesomeIconList").push({
"src": "sap-icon://fontawesome-solid/" + icon.name,
"name": icon.name,
"unicode": icon.unicode
});
}
});
oModel.refresh(true);
});
},
getSimpleLineIcons: function () {
oModel.setProperty("/SimpleLineIconList", []);
SimpleLineIcons.getIcons(function (allIcons) {
allIcons.map(function (icon) {
if (icon.unicode) {
sap.ui.core.IconPool.addIcon(icon.name, "lineicons", "lineicons", icon.unicode);
oModel.getProperty("/SimpleLineIconList").push({
"src": "sap-icon://lineicons/" + icon.name,
"name": icon.name,
"unicode": icon.unicode
});
}
});
oModel.refresh(true);
});
},
getFontIcons: function () {
oModel.setProperty("/FontIconList", []);
FontIcons.getIcons(function (allIcons) {
allIcons.map(function (icon) {
if (icon.unicode) {
sap.ui.core.IconPool.addIcon(icon.name, "icofont", "icofont", icon.unicode);
oModel.getProperty("/FontIconList").push({
"src": "sap-icon://icofont/" + icon.name,
"name": icon.name,
"unicode": icon.unicode
});
}
});
oModel.refresh(true);
});
},
});
});