瀏覽代碼

Prevent undefined error

Amauri CHAMPEAUX 10 年之前
父節點
當前提交
6d48a8e1fb
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. 6 1
      tarteaucitron.js

+ 6 - 1
tarteaucitron.js

@@ -630,6 +630,9 @@ var tarteaucitron = {
                 tarteaucitron.userInterface.jsSizing('cookie');
                 tarteaucitron.userInterface.css('tarteaucitron', 'display', 'none');
                 tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'block');
+                tarteaucitron.fallback(['tarteaucitronInfoBox'], function (elem) {
+                    elem.style.display = 'none';
+                }, true);
             } else {
                 div.style.display = 'none';
                 tarteaucitron.userInterface.css('tarteaucitron', 'display', 'none');
@@ -661,7 +664,7 @@ var tarteaucitron = {
         "order": function (id) {
             "use strict";
             var main = document.getElementById('tarteaucitronServices_' + id),
-                allDivs = main.childNodes,
+                allDivs,
                 store = [],
                 i;
 
@@ -669,6 +672,8 @@ var tarteaucitron = {
                 return;
             }
             
+            allDivs = main.childNodes;
+            
             if (typeof Array.prototype.map === 'function') {
                 Array.prototype.map.call(main.children, Object).sort(function (a, b) {
                     if (tarteaucitron.services[a.id.replace(/Line/g, '')].name > tarteaucitron.services[b.id.replace(/Line/g, '')].name) { return 1; }