From 608becef7dd7f3af88bc7f81ecc90c30ae816980 Mon Sep 17 00:00:00 2001 From: Mohammed Nafees Date: Wed, 7 Jun 2017 15:51:27 +0530 Subject: [PATCH] Make the back button work again, uses the browser history directly now. --- scripts/system/html/js/marketplacesInject.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/scripts/system/html/js/marketplacesInject.js b/scripts/system/html/js/marketplacesInject.js index d4937ac9db..3b3d4b4937 100644 --- a/scripts/system/html/js/marketplacesInject.js +++ b/scripts/system/html/js/marketplacesInject.js @@ -25,9 +25,7 @@ var canWriteAssets = false; var xmlHttpRequest = null; var isPreparing = false; // Explicitly track download request status. - - var lastPage = "https://metaverse.highfidelity.com/marketplace?"; - + function injectCommonCode(isDirectoryPage) { // Supporting styles from marketplaces.css. @@ -67,7 +65,7 @@ // Footer actions. $("#back-button").on("click", function () { - window.location = lastPage; + window.history.back(); }); $("#all-markets").on("click", function () { EventBridge.emitWebEvent(GOTO_DIRECTORY); @@ -344,12 +342,7 @@ } } - function locationChanged() { - lastPage = location.href; - } - // Load / unload. window.addEventListener("load", onLoad); // More robust to Web site issues than using $(document).ready(). - window.addEventListener("hashchange", locationChanged); }());