diff --git a/material/login/resources/js/polyfill/nodelist-foreach.js b/material/login/resources/js/polyfill/nodelist-foreach.js new file mode 100644 index 0000000..d69a987 --- /dev/null +++ b/material/login/resources/js/polyfill/nodelist-foreach.js @@ -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); + } + }; +} \ No newline at end of file diff --git a/material/login/theme.properties b/material/login/theme.properties index d27e54b..51f394e 100644 --- a/material/login/theme.properties +++ b/material/login/theme.properties @@ -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/