소스 검색

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)

Nicolas Rosset 4 년 전
부모
커밋
1339816a1a
1개의 변경된 파일9개의 추가작업 그리고 0개의 파일을 삭제
  1. 9 0
      tarteaucitron.js

+ 9 - 0
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);
+            });
+        }
     }
 };