From 1339816a1a316e128c0f1ef72490f236ed34d5c3 Mon Sep 17 00:00:00 2001 From: Nicolas Rosset Date: Wed, 3 Mar 2021 16:57:23 +0100 Subject: [PATCH] Add function to trigger all jobs after ajax call that add
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) --- tarteaucitron.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tarteaucitron.js b/tarteaucitron.js index bfd49f3..2fd2fff 100644 --- a/tarteaucitron.js +++ b/tarteaucitron.js @@ -1819,5 +1819,14 @@ var tarteaucitron = { 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); + }); + } } };