Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

Preserve anchors - Fix #110
  • Loading branch information...
commit 5f156b306e938814988a9f35a72278287af0ab3c 2 parents b75edae + fadab58
@dhh dhh authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/assets/javascripts/turbolinks.js.coffee
View
4 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
Please sign in to comment.
Something went wrong with that request. Please try again.