add polyfill for .forEach

This commit is contained in:
MarkEEaton
2021-09-17 10:23:01 -04:00
committed by GitHub
parent d6d3cbac4d
commit 5f961490b5
+12 -5
View File
@@ -467,6 +467,18 @@ window.onload = function () {
}; };
</script> </script>
<!-- polyfills to make .forEach and .includes work in IE10 and IE11 -->
<script type="text/javascript">
if (window.NodeList && !NodeList.prototype.forEach) {
NodeList.prototype.forEach = Array.prototype.forEach;
}
String.prototype.includes = function(match) {
return this.indexOf(match) !== -1;
}
</script>
<!-- script to make OneSearch dropdown work --> <!-- script to make OneSearch dropdown work -->
<script type="text/javascript"> <script type="text/javascript">
function customizeSearch(facet) { function customizeSearch(facet) {
@@ -500,11 +512,6 @@ function customizeSearch(facet) {
<!-- OneSearch widget script from OLS, modified --> <!-- OneSearch widget script from OLS, modified -->
<script type="text/javascript"> <script type="text/javascript">
// make .includes backward compatible to IE
String.prototype.includes = function(match) {
return this.indexOf(match) !== -1;
}
function addPrimoQuery(e) { function addPrimoQuery(e) {
// prevent the user from submitting the form if no dropdown item has been selected. Added by ME. // prevent the user from submitting the form if no dropdown item has been selected. Added by ME.
e.preventDefault(); e.preventDefault();