Skip to content

Commit 5decf36

Browse files
author
veeck
committed
Cleanup calendar layout and script
1 parent 8a13ca1 commit 5decf36

File tree

2 files changed

+6
-20
lines changed

2 files changed

+6
-20
lines changed

modules/default/calendar/calendar.css

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,14 @@
22
display: flex;
33
flex-direction: row;
44
justify-content: flex-end;
5-
padding-left: 0;
6-
padding-right: 10px;
7-
font-size: var(--font-size-small);
8-
}
9-
10-
.calendar .symbol span {
11-
padding-top: 4px;
5+
gap: 5px;
126
}
137

148
.calendar .title {
15-
padding-left: 0;
16-
padding-right: 0;
17-
vertical-align: top;
9+
padding: 0 10px;
1810
}
1911

2012
.calendar .time {
21-
padding-left: 30px;
13+
padding-left: 20px;
2214
text-align: right;
23-
vertical-align: top;
2415
}

modules/default/calendar/calendar.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,8 @@ Module.register("calendar", {
168168

169169
this.selfUpdate();
170170
},
171-
notificationReceived (notification, payload, sender) {
172171

172+
notificationReceived (notification, payload, sender) {
173173
if (notification === "FETCH_CALENDAR") {
174174
if (this.hasCalendarURL(payload.url)) {
175175
this.sendSocketNotification(notification, { url: payload.url, id: this.identifier });
@@ -217,7 +217,6 @@ Module.register("calendar", {
217217

218218
// Override dom generator.
219219
getDom () {
220-
const ONE_SECOND = 1000; // 1,000 milliseconds
221220
const events = this.createEventList(true);
222221
const wrapper = document.createElement("table");
223222
wrapper.className = this.config.tableClass;
@@ -308,15 +307,12 @@ Module.register("calendar", {
308307
}
309308

310309
const symbolClass = this.symbolClassForUrl(event.url);
311-
symbolWrapper.className = `symbol align-right ${symbolClass}`;
310+
symbolWrapper.className = `symbol ${symbolClass}`;
312311

313312
const symbols = this.symbolsForEvent(event);
314-
symbols.forEach((s, index) => {
313+
symbols.forEach((s) => {
315314
const symbol = document.createElement("span");
316315
symbol.className = s;
317-
if (index > 0) {
318-
symbol.style.paddingLeft = "5px";
319-
}
320316
symbolWrapper.appendChild(symbol);
321317
});
322318
eventWrapper.appendChild(symbolWrapper);
@@ -601,7 +597,6 @@ Module.register("calendar", {
601597
*/
602598
createEventList (limitNumberOfEntries) {
603599
let now = moment();
604-
let today = now.clone().startOf("day");
605600
let future = now.clone().startOf("day").add(this.config.maximumNumberOfDays, "days");
606601

607602
let events = [];

0 commit comments

Comments
 (0)