瀏覽代碼

Event loaded should be sent after js script is executed in order to be able to manipulate result of the script after loaded event is sent

Luc MULLER 3 年之前
父節點
當前提交
bf61aec1e1
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      tarteaucitron.js

+ 1 - 1
tarteaucitron.js

@@ -1004,8 +1004,8 @@ var tarteaucitron = {
                     tarteaucitron.pro('!' + key + '=engage');
                     tarteaucitron.pro('!' + key + '=engage');
 
 
                     tarteaucitron.launch[key] = true;
                     tarteaucitron.launch[key] = true;
-                    tarteaucitron.sendEvent(key + '_loaded');
                     if (typeof tarteaucitronMagic === 'undefined' || tarteaucitronMagic.indexOf("_" + key + "_") < 0) { tarteaucitron.services[key].js(); }
                     if (typeof tarteaucitronMagic === 'undefined' || tarteaucitronMagic.indexOf("_" + key + "_") < 0) { tarteaucitron.services[key].js(); }
+                    tarteaucitron.sendEvent(key + '_loaded');
                 }
                 }
             }
             }
             var itemStatusElem = document.getElementById('tacCurrentStatus'+key);
             var itemStatusElem = document.getElementById('tacCurrentStatus'+key);