diff --git a/app/templates/main_admin.html b/app/templates/main_admin.html index 8a28ab6..52cd764 100644 --- a/app/templates/main_admin.html +++ b/app/templates/main_admin.html @@ -43,7 +43,7 @@ $(function () { $('[data-toggle="tooltip"]').tooltip(); $('#entryToggle').change(function() { - $.ajax({url: "/api/entries/accept/"+($('#entryToggle').is(":checked") ? "1" : "0"), complete: refreshEntryToggle}); + $.ajax({url: "/api/entries/accept/"+($('#entryToggle').is(":checked") ? "1" : "0"), complete: setTimeout(refreshEntryToggle, 500)}); }) refreshEntryToggle(); }) diff --git a/app/templates/songlist.html b/app/templates/songlist.html index 01d420f..c91612e 100644 --- a/app/templates/songlist.html +++ b/app/templates/songlist.html @@ -56,18 +56,13 @@ $("#songtable").html("") $(items.join("")).appendTo("#songtable"); + entriesAccepted() }); } else { $("#songtable").html("") } }); - $.getJSON("/api/entries/accept", (data) => { - if (data["value"]==0) { - $("#filter").prop("disabled",true); - } - }) - $("#nameForm").submit( function (e) { e.preventDefault(); submitModal(); @@ -114,5 +109,12 @@ } + + function entriesAccepted() { + $.getJSON("/api/entries/accept", (data,out) => { + $(".enqueueButton").prop("disabled",!data["value"]) + }) + } + {% endblock %} \ No newline at end of file