-
Notifications
You must be signed in to change notification settings - Fork 61
Expand file tree
/
Copy pathCALEXT2_Legend.js
More file actions
39 lines (36 loc) · 1.17 KB
/
CALEXT2_Legend.js
File metadata and controls
39 lines (36 loc) · 1.17 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
/* global View */
// eslint-disable-next-line no-unused-vars
class ViewLegend extends View {
draw () {
this.drawDom();
this.drawLegend();
}
drawLegend () {
for (let i = 0; i < this.config.calendarLegends.length; i++) {
const calendar = this.config.calendarLegends[i];
const tlDom = document.createElement("div");
tlDom.classList.add("legendSlot", "event");
tlDom.dataset.calendarName = calendar.name;
if (calendar.className) {
tlDom.classList.add(calendar.className);
}
if (calendar.icon) {
const iconDom = document.createElement("div");
iconDom.classList.add("iconify", "eventIcon");
iconDom.dataset.icon = calendar.icon;
tlDom.appendChild(iconDom);
}
const title = document.createElement("div");
title.innerHTML = calendar.name;
title.classList.add("eventTitle");
tlDom.appendChild(title);
this.contentDom.append(tlDom);
}
this.makeModuleTitle();
}
makeModuleTitle () {
if (!this.config.title) return;
const headerTitle = this.moduleDom.getElementsByClassName("module-header");
headerTitle[0].innerHTML = this.config.title;
}
}