Created
October 5, 2012 06:24
-
-
Save jackprophesy/3838395 to your computer and use it in GitHub Desktop.
document ready turbolinks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--THIS------------------------------------------ | |
$(document).ready -> | |
$("a[rel=popover]").popover() | |
--OR THIS--------------------------------------- | |
$ -> | |
$("a[rel=popover]").popover() | |
--BECOMES--------------------------------------- | |
initPage = -> | |
$("a[rel=popover]").popover() | |
$ -> | |
initPage() | |
$(window).bind "page:change", -> | |
initPage() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
it may also be pertinant to use page:load as page:change does not reset dom listeners anymore when hitting the back button. but page:load fires when a page is actually fetched and created.