From dc5d88d93d4529169429c91a631b80cff7ca605a Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Thu, 8 Aug 2013 11:51:13 -0700 Subject: [PATCH] Add a hash if one isn't already present --- app/views/site/id.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/site/id.html.erb b/app/views/site/id.html.erb index 53e177a3f..1b4cdf1bb 100644 --- a/app/views/site/id.html.erb +++ b/app/views/site/id.html.erb @@ -51,7 +51,7 @@ // http://bl.ocks.org/jfirebaugh/5439412 var hash = parent.OSM.formatHash({ lon: center[0], lat: center[1], zoom: zoom }); if (hash !== parent.location.hash) { - parent.location.replace(parent.location.href.replace(/#.*/, hash)); + parent.location.replace(parent.location.href.replace(/(#.*|$)/, hash)); } })); -- 2.43.2