[F.END] Print 'no event' correctly

This commit is contained in:
giuliof 2020-07-27 21:38:21 +02:00
parent 2c098c38b6
commit 6c54a91e89
1 changed files with 6 additions and 4 deletions

View File

@ -5,10 +5,7 @@ function zerocalcareDisplay() {
if (xhr.readyState == 4 && xhr.status == 200) {
var json_obj = JSON.parse(xhr.responseText);
if (json_obj.length == 0) {
zerocalcareOutput.childNodes[0].textContent = 'Nessun appuntamento in programma';
}
var atLeastOne = false;
for (i in json_obj) {
// Do not display private events
@ -89,6 +86,11 @@ function zerocalcareDisplay() {
eventElement.appendChild(timeElement);
eventElement.appendChild(locationElement);
zerocalcareOutput.appendChild(eventElement);
atLeastOne = true;
}
if (atLeastOne == false) {
zerocalcareOutput.childNodes[0].textContent = 'Nessun appuntamento in programma';
}
}
else {