Permalink
Browse files

Merge pull request #125 from reednj77/lost-anchors-fix

Preserve anchors - Fix #110
  • Loading branch information...
2 parents b75edae + fadab58 commit 5f156b306e938814988a9f35a72278287af0ab3c @dhh dhh committed Dec 1, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/assets/javascripts/turbolinks.js.coffee
@@ -90,8 +90,8 @@ reflectNewUrl = (url) ->
window.history.pushState { turbolinks: true, position: currentState.position + 1 }, '', url
reflectRedirectedUrl = (xhr) ->
- if (location = xhr.getResponseHeader('X-XHR-Current-Location'))
- window.history.replaceState currentState, '', location
+ unless (location = xhr.getResponseHeader 'X-XHR-Current-Location') is document.location.pathname + document.location.search
+ window.history.replaceState currentState, '', location + document.location.hash
rememberCurrentUrl = ->
window.history.replaceState { turbolinks: true, position: Date.now() }, '', document.location.href

0 comments on commit 5f156b3

Please sign in to comment.