1
0
mirror of synced 2025-12-19 09:50:12 -05:00

adding polyfill for NodeList.forEach

This commit is contained in:
Nathan Friend
2018-05-24 10:05:20 -03:00
parent 643362591d
commit 25bf3a4951
2 changed files with 12 additions and 1 deletions

View File

@@ -0,0 +1,11 @@
// Taken from https://developer.mozilla.org/en-US/docs/Web/API/NodeList/forEach
// Allows for document.querySelectorAll('.selector').forEach(...)
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);
}
};
}

View File

@@ -1,7 +1,7 @@
parent=base
styles=css/material-components-web.min.css css/bootstrap-material-design-alerts.css css/material-keycloak-theme.css
scripts=js/material-components-web.min.js js/material-keycloak-theme.js
scripts=js/polyfill/nodelist-foreach.js js/material-components-web.min.js js/material-keycloak-theme.js
kcLogoLink=https://www.maximuscanada.ca/