-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsettings.js
70 lines (61 loc) · 1.8 KB
/
settings.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
var body = $('body');
var html = $('html');
function quixSettings({ fontFamily, bodybg, primarycolor }) {
this.fontFamily = fontFamily || "light";
this.bodybg = bodybg || "color_1";
this.primarycolor = primarycolor || "color_1";
this.manageFont();
this.manageBodyBg();
this.primaryColor();
}
quixSettings.prototype.manageFont = function() {
switch(this.fontFamily) {
case "opensans":
body.attr("data-font", "opensans");
break;
default:
body.attr("data-font", "lato");
}
}
quixSettings.prototype.manageBodyBg = function () {
switch (this.bodybg) {
case "color_1":
body.attr("data-bodybg", "color_1");
break;
case "color_2":
body.attr("data-bodybg", "color_2");
break;
case "color_3":
body.attr("data-bodybg", "color_3");
break;
case "color_4":
body.attr("data-bodybg", "color_4");
break;
case "color_5":
body.attr("data-bodybg", "color_5");
break;
default:
body.attr("data-bodybg", "color_1");
}
}
quixSettings.prototype.primaryColor = function() {
switch(this.primarycolor) {
case "color_1":
body.attr("data-primary-color", "color_1");
break;
case "color_2":
body.attr("data-primary-color", "color_2");
break;
case "color_3":
body.attr("data-primary-color", "color_3");
break;
case "color_4":
body.attr("data-primary-color", "color_4");
break;
case "color_5":
body.attr("data-primary-color", "color_5");
break;
default:
body.attr("data-primary-color", "color_1");
}
}