periodic gather count update

Made it so the page updates the gather fill status in the navigation periodicaly (every 10 seconds)
This commit is contained in:
Absurdon 2016-12-21 18:30:12 +01:00 committed by Ari Timonen
parent 8ca9dfb7fe
commit ac2e95799c

View file

@ -80,12 +80,15 @@
</nav> </nav>
<script> <script>
$(function () { $(function () {
$.ajax({ var gatherInterval = setInterval(function() {
datatype: "json", $.ajax({
url: "<%= gathers_url %>/gathers/current", datatype: "json",
success: function (data) { url: "<%= gathers_url %>/gathers/current",
$("#gathercount").html(data.gatherers.length + "/12"); success: function (data) {
} $("#gathercount").html(data.gatherers.length + "/12");
}); }
});
},10000);
}); });
</script> </script>