Skip to content

Commit 56e8f24

Browse files
committed
Hide line break if event has no location
1 parent 4a4b4cc commit 56e8f24

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

static/js/calendar.js

+8
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,14 @@ function displayInfoPanel(target, event) {
244244
`${event.when_human.start_time}${event.when_human.end_time} ${event.when_human.long_start_date}`
245245
document.getElementById('calendar-info-where').innerText = event.location;
246246

247+
// If there's no "where", hide the line break between "when" and "where"
248+
// so we don't have a useless break
249+
if (!event.location || event.location.trim() == '') {
250+
document.getElementById('calendar-info-br').style.display = 'none';
251+
} else {
252+
document.getElementById('calendar-info-br').style.display = 'initial';
253+
}
254+
247255
const desc = document.getElementById('calendar-info-description');
248256
desc.innerHTML = event.description;
249257
while (desc.firstChild.nodeName.toLowerCase() == "br") {

templates/calendar.handlebars

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
<a href="javascript:closeInfoPanel()" aria-label="Close Event Info Panel" id="calendar-info-close">&times;</a>
4949
<h3 id="calendar-info-title"></h4>
5050
<b id="calendar-info-when"></b>
51-
<br>
51+
<br id="calendar-info-br">
5252
<b id="calendar-info-where"></b>
5353
<a href="#" id="calendar-join-button" class="hidden">Join Google Meet</a>
5454
<div id="calendar-info-description"></div>

0 commit comments

Comments
 (0)