rails/turbolinks — pull request #356 by mrloop (2014-03-29 19:12:38+00:00)
Title: Mechanism to override body replace

This commit keeps the default behaviour but lets you override the default behaviour of replacing the body tag.

Here's an example of me overriding the default behaviour.
```coffee
$ ->
$(document).on 'page:replace', (e) ->
turboElement = document.getElementById 'turbolinks-replace'
newTurboElement = $(e.originalEvent.data.html).find('#turbolinks-replace')[0]
turboElement.parentElement.replaceChild newTurboElement, turboElement
false #cancel default turbo link replace
```

I've got a long running video background I don't want reloaded every page replace.

https://github.com/rails/turbolinks/pull/204, I also ran into the page caching issue described here when overriding the default behaviour