# HG changeset patch # User edogawaconan # Date 1392808880 -32400 # Node ID e855e58d137e3a92cc06f87b7f200b25e5e53786 # Parent 1a409564ffadc08b5ac7a8790041770f24cf0eb7 Always include current path when replacing state. diff -r 1a409564ffad -r e855e58d137e app/assets/javascripts/zp.hash_magic.js --- a/app/assets/javascripts/zp.hash_magic.js Wed Feb 19 19:53:42 2014 +0900 +++ b/app/assets/javascripts/zp.hash_magic.js Wed Feb 19 20:21:20 2014 +0900 @@ -17,10 +17,9 @@ } var format = zp.formatter.current(), - hash = "#" - hash += format - if (hash === "#pl") { hash = " " } - history.replaceState(null, "", hash) + newpath = window.location.pathname + if (format !== "pl") { newpath += "#" + format } + history.replaceState(null, "", newpath) }, init: function() { if (!$("#paste").length) return