If the browser doesn't support Turbolinks, when `Turbolinks.visit()` was being called with no parameters `document.location.href = undefined` was executed, resulting in a request to a non-existent route. This is not happening if the browser does support Turbolinks. This commit fixes this issue.
Fix #551. Partial replacement broke the page cache by caching body.outerHTML (losing all DOM state in the process) instead of the body element itself. This commit brings back the old behavior, with the following gotcha: when a partial replacement is performed, we remove the current page from the cache, since the body element will not change and there is no simple way for us to bring back the changed nodes. Additionally: - page:after-remove on body elements now triggers on cache eviction (since we don't want to lose DOM state) - to avoid triggering page:load on the same body elements more than once, a partial replacement now triggers the page:partial-load event
Safari 5 supports history.pushState but not history.state. Turbolinks uses both history.pushState and history.state, but only checks for history.pushState. Without this fix, a js error occurs. In our case this resulted in the progressbar filling the entire screen.
…hange` option from restoring page (and scrolling up while doing so).