From 3c016c8fa03b9cb053e535f8efed666f1223e7fa Mon Sep 17 00:00:00 2001 From: Thomas Forgione Date: Tue, 4 Dec 2018 15:31:04 +0100 Subject: [PATCH] Added refresh button --- static/js/calendar.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/static/js/calendar.js b/static/js/calendar.js index 0ced784..3caca4d 100644 --- a/static/js/calendar.js +++ b/static/js/calendar.js @@ -7,6 +7,7 @@ var calendar; function getTable() { // Send XHR to totalTable + resultDiv.innerHTML = ''; loadingDiv.style.display = ""; errorDiv.style.display = "none"; @@ -27,7 +28,6 @@ function getTable() { } function setData(events) { - console.log(events); loadingDiv.style.display = "none"; errorDiv.style.display = "none"; calendar = new FullCalendar.Calendar(resultDiv, { @@ -41,10 +41,18 @@ function setData(events) { eventClick: function(info) { info.jsEvent.preventDefault(); }, + customButtons: { + refreshCalendar: { + text: "Refresh", + click: function() { + getTable(); + }, + }, + }, header: { left: 'title', center: '', - right: 'month,agendaWeek,agendaDay prev,next today' + right: 'refreshCalendar month,agendaWeek,agendaDay prev,next today' } }); calendar.render();