Skip to content
This repository has been archived by the owner on Jul 28, 2018. It is now read-only.

Commit

Permalink
Merge pull request #125 from reednj77/lost-anchors-fix
Browse files Browse the repository at this point in the history
Preserve anchors - Fix #110
  • Loading branch information
dhh committed Dec 1, 2012
2 parents b75edae + fadab58 commit 5f156b3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/assets/javascripts/turbolinks.js.coffee
Expand Up @@ -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
Expand Down

0 comments on commit 5f156b3

Please sign in to comment.