Browse Source

feat: add event functions to init and load

Romain GABORIEAU 6 years ago
parent
commit
8b1696cf20
1 changed files with 12 additions and 0 deletions
  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";