luci-base: cbi.js: add NodeList.forEach() polyfill for IE 11

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
Jo-Philipp Wich 2018-07-07 15:14:43 +02:00
parent c0de036b31
commit 260d2cc44e

View file

@ -1498,6 +1498,15 @@ String.nobr = function()
return ''.nobr.apply(arguments[0], a);
}
if (window.NodeList && !NodeList.prototype.forEach) {
NodeList.prototype.forEach = function (callback, thisArg) {
thisArg = thisArg || window;
for (var i = 0; i < this.length; i++) {
callback.call(thisArg, this[i], i, this);
}
};
}
var dummyElem, domParser;