Add function to trigger all jobs after ajax call that add <div> handled by TAC (simply add an onclick="tarteaucitron.triggerJobsAfterAjaxCall();" and the browser fire again all the jobs + fix the click on the allow button if cookies are not allowed)

This commit is contained in:
Nicolas Rosset 2021-03-03 16:57:23 +01:00
parent 6f4c8d30c1
commit 1339816a1a
1 changed files with 9 additions and 0 deletions

View File

@ -1819,5 +1819,14 @@ var tarteaucitron = {
e.attachEvent("onclick", func); e.attachEvent("onclick", func);
} }
} }
},
"triggerJobsAfterAjaxCall": function() {
tarteaucitron.job.forEach(function(e) { tarteaucitron.job.push(e) });
var allowBtns = document.getElementsByClassName("tarteaucitronAllow");
for (i = 0; i < allowBtns.length; i++) {
tarteaucitron.addClickEventToElement(allowBtns[i], function () {
tarteaucitron.userInterface.respond(this, true);
});
}
} }
}; };