From 55673782343f1470ef2f42823cc220da59b4797c Mon Sep 17 00:00:00 2001 From: Baris Soner Usakli Date: Tue, 25 Feb 2014 15:10:50 -0500 Subject: [PATCH 1/2] change hash take 2 --- public/src/forum/topic.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/public/src/forum/topic.js b/public/src/forum/topic.js index 5ab2467b33..80aa2fa4cb 100644 --- a/public/src/forum/topic.js +++ b/public/src/forum/topic.js @@ -1023,7 +1023,12 @@ define(['composer', 'forum/pagination'], function(composer, pagination) { localStorage.removeItem("topic:" + templates.get('topic_id') + ":bookmark"); } else { localStorage.setItem("topic:" + templates.get('topic_id') + ":bookmark", el.attr('data-pid')); - window.location.hash = el.attr('data-pid'); + + if(history.pushState) { + history.replaceState(null, window.location.protocol + '//' + window.location.host + window.location.pathname, '#' + el.attr('data-pid')); + } else { + location.hash = '#' + el.attr('data-pid'); + } } return false; } From a3855a47e5e18e1c83aca1f349ee116e84c38d28 Mon Sep 17 00:00:00 2001 From: Baris Soner Usakli Date: Tue, 25 Feb 2014 15:12:42 -0500 Subject: [PATCH 2/2] check replaceState --- public/src/forum/topic.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/src/forum/topic.js b/public/src/forum/topic.js index 80aa2fa4cb..7ee9806f5a 100644 --- a/public/src/forum/topic.js +++ b/public/src/forum/topic.js @@ -1024,7 +1024,7 @@ define(['composer', 'forum/pagination'], function(composer, pagination) { } else { localStorage.setItem("topic:" + templates.get('topic_id') + ":bookmark", el.attr('data-pid')); - if(history.pushState) { + if(history.replaceState) { history.replaceState(null, window.location.protocol + '//' + window.location.host + window.location.pathname, '#' + el.attr('data-pid')); } else { location.hash = '#' + el.attr('data-pid');