luci-base: cbi.js: add NodeList.forEach() polyfill for IE 11
authorJo-Philipp Wich <jo@mein.io>
Sat, 7 Jul 2018 13:14:43 +0000 (15:14 +0200)
committerJo-Philipp Wich <jo@mein.io>
Mon, 9 Jul 2018 09:51:43 +0000 (11:51 +0200)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-base/htdocs/luci-static/resources/cbi.js

index 6a487366f8a5d652d348025237d2991e75a99fc8..74b275742c637d7394e5c433244ecce46c5e85ce 100644 (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;