Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Pass $ as the first arg in callbacks (Closes #26)

  • Loading branch information...
commit 41953e7630b9ae2740ded695e42d406f643d2e43 1 parent c8e04bb
@rstacruz rstacruz authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/jquery.turbolinks.coffee
View
6 src/jquery.turbolinks.coffee
@@ -22,8 +22,10 @@ $.turbo =
.on("#{fetch}.turbo", @onFetch)
addCallback: (callback) ->
- $document.on('turbo:ready', callback)
- callback($) if $.turbo.isReady
+ if $.turbo.isReady
+ callback($)
+ else
+ $document.on 'turbo:ready', -> callback($)
onLoad: ->
$.turbo.isReady = true
Please sign in to comment.
Something went wrong with that request. Please try again.