Re-render periodically
This commit is contained in:
parent
72a92916c3
commit
becd485d4d
1 changed files with 10 additions and 2 deletions
|
@ -96,10 +96,18 @@ function renderEvent(event, container) {
|
||||||
prevDate = startDate;
|
prevDate = startDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
function onPageReady() {
|
function render() {
|
||||||
window.removeEventListener('load', onPageReady, false);
|
|
||||||
const table = document.getElementById('events');
|
const table = document.getElementById('events');
|
||||||
|
while (table.firstChild) {
|
||||||
|
table.removeChild(table.firstChild);
|
||||||
|
}
|
||||||
const events = getEvents(17);
|
const events = getEvents(17);
|
||||||
events.forEach(event => renderEvent(event, table));
|
events.forEach(event => renderEvent(event, table));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onPageReady() {
|
||||||
|
window.removeEventListener('load', onPageReady, false);
|
||||||
|
render();
|
||||||
|
setInterval(render, 30000);
|
||||||
|
}
|
||||||
window.addEventListener('load', onPageReady, false);
|
window.addEventListener('load', onPageReady, false);
|
||||||
|
|
Loading…
Reference in a new issue