Explorar o código

feat: add event functions to init and load

Romain GABORIEAU %!s(int64=6) %!d(string=hai) anos
pai
achega
8b1696cf20
Modificáronse 1 ficheiros con 12 adicións e 0 borrados
  1. 12 0
      tarteaucitron.js

+ 12 - 0
tarteaucitron.js

@@ -28,6 +28,10 @@ var tarteaucitron = {
     "parameters": {},
     "isAjax": false,
     "reloadThePage": false,
+    "events": {
+        "init": function () {},
+        "load": function () {},
+    },
     "init": function (params) {
         "use strict";
         var origOpen;
@@ -190,6 +194,10 @@ var tarteaucitron = {
                 };
             }
         }
+
+        if(tarteaucitron.events.init) {
+            tarteaucitron.events.init();
+        }
     },
     "load": function () {
         "use strict";
@@ -481,6 +489,10 @@ var tarteaucitron = {
                 }
             });
         });
+
+        if(tarteaucitron.events.load) {
+            tarteaucitron.events.load();
+        }
     },
     "addService": function (serviceId) {
         "use strict";