Inprovements to entry disabling.

This commit is contained in:
Phillip Kühne 2019-08-21 22:39:42 +02:00
parent ac2efc29c9
commit 7629eed323
2 changed files with 9 additions and 7 deletions

View File

@ -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();
})

View File

@ -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"])
})
}
</script>
{% endblock %}