Skip to content
This repository was archived by the owner on Feb 2, 2025. It is now read-only.

Commit 0400ac9

Browse files
author
Dmitriy T
committed
Fixes for IE8. Replace missing IE8 Array methods forEach and indexOf with Angular and JQuery equivalents.
1 parent bcfa841 commit 0400ac9

4 files changed

+13
-13
lines changed

dist/angular-datatables.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -773,15 +773,15 @@ function dtRendererService(DTLoadingTemplate) {
773773
}
774774

775775
function postRender(options, result) {
776-
plugins.forEach(function(plugin) {
776+
angular.forEach(plugins, function(plugin) {
777777
if (angular.isFunction(plugin.postRender)) {
778778
plugin.postRender(options, result);
779779
}
780780
});
781781
}
782782

783783
function preRender(options) {
784-
plugins.forEach(function(plugin) {
784+
angular.forEach(plugins, function(plugin) {
785785
if (angular.isFunction(plugin.preRender)) {
786786
plugin.preRender(options);
787787
}
@@ -1231,7 +1231,7 @@ function dtPropertyUtil($q) {
12311231
} else {
12321232
resolvedObj = angular.extend(resolvedObj, obj);
12331233
for (var prop in resolvedObj) {
1234-
if (resolvedObj.hasOwnProperty(prop) && excludedProp.indexOf(prop) === -1) {
1234+
if (resolvedObj.hasOwnProperty(prop) && $.inArray(prop, excludedProp) === -1) {
12351235
if (angular.isArray(resolvedObj[prop])) {
12361236
promises.push(resolveArrayPromises(resolvedObj[prop]));
12371237
} else {
@@ -1242,7 +1242,7 @@ function dtPropertyUtil($q) {
12421242
$q.all(promises).then(function(result) {
12431243
var index = 0;
12441244
for (var prop in resolvedObj) {
1245-
if (resolvedObj.hasOwnProperty(prop) && excludedProp.indexOf(prop) === -1) {
1245+
if (resolvedObj.hasOwnProperty(prop) && $.inArray(prop, excludedProp) === -1) {
12461246
resolvedObj[prop] = result[index++];
12471247
}
12481248
}
@@ -1264,15 +1264,15 @@ function dtPropertyUtil($q) {
12641264
if (!angular.isArray(array)) {
12651265
defer.resolve(array);
12661266
} else {
1267-
array.forEach(function(item) {
1267+
angular.forEach(array, function(item) {
12681268
if (angular.isObject(item)) {
12691269
promises.push(resolveObjectPromises(item));
12701270
} else {
12711271
promises.push($q.when(item));
12721272
}
12731273
});
12741274
$q.all(promises).then(function(result) {
1275-
result.forEach(function(item) {
1275+
angular.forEach(result, function(item) {
12761276
resolveArray.push(item);
12771277
});
12781278
defer.resolve(resolveArray);

0 commit comments

Comments
 (0)