From: Jo-Philipp Wich Date: Sat, 7 Jul 2018 13:14:43 +0000 (+0200) Subject: luci-base: cbi.js: add NodeList.forEach() polyfill for IE 11 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=260d2cc44e1954d0ef019845b29fee57d22e8020;p=project%2Fluci.git luci-base: cbi.js: add NodeList.forEach() polyfill for IE 11 Signed-off-by: Jo-Philipp Wich --- diff --git a/modules/luci-base/htdocs/luci-static/resources/cbi.js b/modules/luci-base/htdocs/luci-static/resources/cbi.js index 6a487366f8..74b275742c 100644 --- a/modules/luci-base/htdocs/luci-static/resources/cbi.js +++ b/modules/luci-base/htdocs/luci-static/resources/cbi.js @@ -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;