From 4507777c365f52a79ea73482056f89926fc9a500 Mon Sep 17 00:00:00 2001 From: Ray Schamp Date: Fri, 8 May 2015 21:39:43 -0400 Subject: [PATCH] Revert "Trigger page changes with hashchange. Fix back button" This reverts commit b184d78c3fc7532fc9bd5463988dac95cc638448. Conflicts: js/scratchx.js --- index.html | 20 ++++++++++---------- js/scratchx.js | 17 ++++++----------- 2 files changed, 16 insertions(+), 21 deletions(-) diff --git a/index.html b/index.html index 68578fa..dc3c128 100644 --- a/index.html +++ b/index.html @@ -12,7 +12,7 @@
-

ScratchX

+

ScratchX

diff --git a/js/scratchx.js b/js/scratchx.js index a25fb37..bb81057 100644 --- a/js/scratchx.js +++ b/js/scratchx.js @@ -289,23 +289,18 @@ function JSshowWarning(extensionData) { var showClickListener = function(e) { /* - * Anything with data-action="show" should switch the view + * Links with data-action="static-link" should switch the view * to that page. Works like tabs sort of. Use like... * - * + * Privacy Policy * */ - window.location.hash = $(this).data("target"); -} + var path = $(this).attr("href").substring(1); + showPage(path); +}; $(window).bind('hashchange', function(e) { - var page = ''; - if (document.location.hash == '') { - page = 'home'; - } else { - page = window.location.hash.substr(1); - } - showPage(page); + if (document.location.hash == '') showPage('home'); }); function showPage(path) {