diff --git a/public/index.html b/public/index.html index 7fd1189..49de5c9 100644 --- a/public/index.html +++ b/public/index.html @@ -1,5 +1,5 @@ - + @@ -13,7 +13,14 @@
-

Examples: game_id/pts/team_id

+
+ Examples + +
diff --git a/src/index.js b/src/index.js index a3de819..528520c 100644 --- a/src/index.js +++ b/src/index.js @@ -83,7 +83,7 @@ window.addEventListener('click', function (ev) { // This expands the full URL even if the link is /relative: var href = a.href; // Split off any existing #fragment - href = href.split('#')[0]; + var [href, hash] = href.split('#'); var linkedHostQuery = href.split('?')[1]; if (matchesCurrentHostAndPath(href)) { // Cancel click, navigate to this + fragment instead @@ -92,7 +92,7 @@ window.addEventListener('click', function (ev) { linkedHostAndPath += '?' + linkedHostQuery; } ev.preventDefault(); - window.location = window.location.protocol + '//' + linkedHostAndPath + window.location.hash; + window.location = window.location.protocol + '//' + linkedHostAndPath + '#' + hash; return false; } return true;