fix the problem with having two window.onload
This commit is contained in:
@@ -383,7 +383,7 @@ jQuery(function(){
|
|||||||
<!-- the code for the hours widget -->
|
<!-- the code for the hours widget -->
|
||||||
<!-- please forgive the old-timey JS; it is there because we need to support IE10 & IE11 -->
|
<!-- please forgive the old-timey JS; it is there because we need to support IE10 & IE11 -->
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
window.onload = function () {
|
function hoursFunction() {
|
||||||
const h = JSON.parse(hours);
|
const h = JSON.parse(hours);
|
||||||
const options_weekday = { weekday: 'long' };
|
const options_weekday = { weekday: 'long' };
|
||||||
const options_weekday_short = { weekday: 'short' };
|
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
|
// 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) {
|
if (sessionStorage.facet && sessionStorage.searchTerms) {
|
||||||
stored_terms = sessionStorage.searchTerms;
|
stored_terms = sessionStorage.searchTerms;
|
||||||
document.getElementById("primoQueryTemp").value = stored_terms;
|
document.getElementById("primoQueryTemp").value = stored_terms;
|
||||||
@@ -499,6 +499,14 @@ function addPrimoQuery(e) {
|
|||||||
}
|
}
|
||||||
</script>
|
</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) -->
|
<!-- 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">-->
|
<!--<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>-->
|
<!--<script type="text/javascript" src="//libapps.s3.amazonaws.com/sites/2365/include/bootstrap-accessibility.min.js"></script>-->
|
||||||
|
|||||||
Reference in New Issue
Block a user