fix the problem with having two window.onload

This commit is contained in:
MarkEEaton
2022-05-03 19:39:46 -04:00
committed by GitHub
parent 13e286439b
commit 12bbd631fc
+10 -2
View File
@@ -383,7 +383,7 @@ jQuery(function(){
<!-- the code for the hours widget -->
<!-- please forgive the old-timey JS; it is there because we need to support IE10 & IE11 -->
<script type="text/javascript">
window.onload = function () {
function hoursFunction() {
const h = JSON.parse(hours);
const options_weekday = { weekday: 'long' };
const options_weekday_short = { weekday: 'short' };
@@ -463,7 +463,7 @@ function customizeSearch(facet) {
}
// if the stored facet exists on page load, render the dropdown with that facet, then clear the stored facet
window.onload = function() {
function sessionFunction() {
if (sessionStorage.facet && sessionStorage.searchTerms) {
stored_terms = sessionStorage.searchTerms;
document.getElementById("primoQueryTemp").value = stored_terms;
@@ -499,6 +499,14 @@ function addPrimoQuery(e) {
}
</script>
<!-- run the hours widget and the sessionStorage stuff on load -->
<script>
window.onload = function () {
hoursFunction()
sessionFunction()
}
</script>
<!-- Load bootstrap accessibility libraries (https://github.com/paypal/bootstrap-accessibility-plugin) -->
<!--<link rel="stylesheet" type="text/css" href="//libapps.s3.amazonaws.com/sites/2365/include/bootstrap-accessibility.min.css">-->
<!--<script type="text/javascript" src="//libapps.s3.amazonaws.com/sites/2365/include/bootstrap-accessibility.min.js"></script>-->