Fixes too many events getting bound to a onclick event, by removing them before attaching the event listener again

This commit is contained in:
Zanz2 2018-07-17 11:41:42 +02:00
parent f67b8d05c7
commit c6ef14290a

View file

@ -9,7 +9,7 @@
// Sets callbacks for toggling checkboxes
function applyCheckboxCallBack() {
$("[data-action='check-item']").on('click', function(e){
$("[data-action='check-item']").off().on('click', function(e){
var checkboxitem = $(this).find("input");
var checked = checkboxitem.is(":checked");
$.ajax({