Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Update comments in source file
Browse files Browse the repository at this point in the history
  • Loading branch information
kossnocorp committed Oct 3, 2012
1 parent 398ebdc commit dbb6208
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/jquery.turbolinks.coffee
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
###
jquery.turbolinks.js ~ v0.1.0 ~ https://github.com/kossnocorp/jquery.turbolinks
jQuery plugin for rebind events problem caused by Tubrolinks
jQuery plugin for drop-in fix binded events problem caused by Turbolinks
The MIT License
Expand All @@ -10,14 +10,19 @@

$ = require?('jquery') || window.jQuery

# List for store callbacks passed to `$` or `$.ready`
callbacks = []

# Call each callback in list
ready = ->
callback() for callback in callbacks

# Bind `ready` to DOM ready event
$(ready)

# Store callbacks in list on `$` and `$.ready`
$.fn.ready = (callback) ->
callbacks.push(callback)

# Bind `ready` to Tubolinks page change event
$(document).on('page:change', ready)

0 comments on commit dbb6208

Please sign in to comment.