[F.END] Print 'no event' correctly
This commit is contained in:
parent
2c098c38b6
commit
6c54a91e89
|
@ -5,10 +5,7 @@ function zerocalcareDisplay() {
|
||||||
if (xhr.readyState == 4 && xhr.status == 200) {
|
if (xhr.readyState == 4 && xhr.status == 200) {
|
||||||
|
|
||||||
var json_obj = JSON.parse(xhr.responseText);
|
var json_obj = JSON.parse(xhr.responseText);
|
||||||
|
var atLeastOne = false;
|
||||||
if (json_obj.length == 0) {
|
|
||||||
zerocalcareOutput.childNodes[0].textContent = 'Nessun appuntamento in programma';
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i in json_obj) {
|
for (i in json_obj) {
|
||||||
// Do not display private events
|
// Do not display private events
|
||||||
|
@ -89,6 +86,11 @@ function zerocalcareDisplay() {
|
||||||
eventElement.appendChild(timeElement);
|
eventElement.appendChild(timeElement);
|
||||||
eventElement.appendChild(locationElement);
|
eventElement.appendChild(locationElement);
|
||||||
zerocalcareOutput.appendChild(eventElement);
|
zerocalcareOutput.appendChild(eventElement);
|
||||||
|
atLeastOne = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (atLeastOne == false) {
|
||||||
|
zerocalcareOutput.childNodes[0].textContent = 'Nessun appuntamento in programma';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Reference in New Issue