Skip to content

Commit

Permalink
Revert "If page is interactive, fire pageLoaded() immediately"
Browse files Browse the repository at this point in the history
  • Loading branch information
javan authored May 3, 2017
1 parent f5f6495 commit 7a8c696
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ Turbolinks emits events that allow you to track the navigation lifecycle and res

* `turbolinks:render` fires after Turbolinks renders the page. This event fires twice during an application visit to a cached location: once after rendering the cached version, and again after rendering the fresh version.

* `turbolinks:load` fires once the first time Turbolinks is loaded, and again after every Turbolinks visit. Access visit timing metrics with the `event.data.timing` object.
* `turbolinks:load` fires once after the initial page load, and again after every Turbolinks visit. Access visit timing metrics with the `event.data.timing` object.

# Contributing to Turbolinks

Expand Down
7 changes: 2 additions & 5 deletions src/turbolinks/controller.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,9 @@ class Turbolinks.Controller
start: ->
if Turbolinks.supported and not @started
addEventListener("click", @clickCaptured, true)
@startHistory()
if document.readyState is "loading"
addEventListener("DOMContentLoaded", @pageLoaded, false)
else
@pageLoaded()
addEventListener("DOMContentLoaded", @pageLoaded, false)
@scrollManager.start()
@startHistory()
@started = true
@enabled = true

Expand Down

0 comments on commit 7a8c696

Please sign in to comment.