From f6af44575cee9d2b1b254cd07afed76900717163 Mon Sep 17 00:00:00 2001 From: Amauri CHAMPEAUX Date: Wed, 4 Mar 2015 19:55:26 +0100 Subject: [PATCH] Some hack for ie 8 - 7 - 6 - 5 --- tarteaucitron.js | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/tarteaucitron.js b/tarteaucitron.js index cfb30c1..a60b1d1 100644 --- a/tarteaucitron.js +++ b/tarteaucitron.js @@ -66,13 +66,17 @@ var tarteaucitron = { tarteaucitronProLoadServices(); } }, false); - } else { + } else if (typeof this.attachEvent !== 'undefined') { this.attachEvent("onload", function () { if (typeof tarteaucitronProLoadServices === 'function') { tarteaucitronProLoadServices(); } }); - } + } else { + if (typeof tarteaucitronProLoadServices === 'function') { + setTimeout(tarteaucitronProLoadServices, 1000); + } + } origOpen.apply(this, arguments); }; } @@ -225,6 +229,19 @@ var tarteaucitron = { tarteaucitron.isAjax = true; tarteaucitron.job.push = function (id) { + + // ie <9 hack + if (typeof tarteaucitron.job.indexOf === 'undefined') { + tarteaucitron.job.indexOf = function (obj, start) { + var i, + j = this.length; + for (i = (start || 0); i < j; i += 1) { + if (this[i] === obj) { return i; } + } + return -1; + }; + } + if (tarteaucitron.job.indexOf(id) === -1) { Array.prototype.push.call(this, id); }