Skip to content

Commit

Permalink
Merge pull request turbolinks#114 from YasuOza/location_reload_when_a…
Browse files Browse the repository at this point in the history
…ssetChanged

document.location.reload() when assetsChanged
  • Loading branch information
dhh committed Nov 26, 2012
2 parents 2360728 + 2c80b5a commit 3ddba5f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/assets/javascripts/turbolinks.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fetchReplacement = (url) ->
doc = createDocument xhr.responseText

if assetsChanged doc
document.location.href = url
document.location.reload()
else
changePage extractTitleAndBody(doc)...
reflectRedirectedUrl xhr
Expand Down
1 change: 1 addition & 0 deletions test/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<li><a href="/reload.html"><span>Asset Change</span></a></li>
<li><a href="/dummy.gif?12345">Query Param Image Link</a></li>
<li><a href="#">Hash link</a></li>
<li><a href="/reload.html#foo">Asset Change with hash link</a></li>
</ul>

<div style="background:#ccc;height:5000px;width:200px;">
Expand Down

0 comments on commit 3ddba5f

Please sign in to comment.