From 18e43210288029dd564aec3e70f5636c6ecc766a Mon Sep 17 00:00:00 2001 From: Lucien Foss Date: Mon, 3 Feb 2014 19:32:44 -0500 Subject: [PATCH] Chrome support fixes --- js/ajax_nav.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/js/ajax_nav.js b/js/ajax_nav.js index 6be0f1c..1d71f7e 100644 --- a/js/ajax_nav.js +++ b/js/ajax_nav.js @@ -1,6 +1,7 @@ "use strict"; -const ajaxRequest = new (function () { +var +ajaxRequest = new (function () { function closeReq () { oLoadingBox.parentNode && document.body.removeChild(oLoadingBox); @@ -101,7 +102,7 @@ const ajaxRequest = new (function () { for (var oLink, nIdx = 0, nLen = document.links.length; nIdx < nLen; document.links[nIdx++].onclick = processLink); } - const +var /* customizable constants */ sTargetId = "ajax-content", sViewKey = "view_as", sAjaxClass = "ajax-nav", @@ -187,10 +188,12 @@ const ajaxRequest = new (function () { oCover.appendChild(oLoadingImg); oLoadingBox.appendChild(oCover); - onpopstate = function (oEvent) { + window.onpopstate = function (oEvent) { bUpdateURL = false; - oPageInfo.title = oEvent.state.title; - oPageInfo.url = oEvent.state.url; + if (oEvent.state) { + oPageInfo.title = oEvent.state.title; + oPageInfo.url = oEvent.state.url; + } getPage(); };