-
Notifications
You must be signed in to change notification settings - Fork 428
Add ability to re-run scripts on back/forward navigation #509
Conversation
👍 |
I'm on board with the functionality, but I'm not sure about the name of the attribute. Seems strange that Off the top of my head, some alternative names could be |
How about |
That would work. |
...by specifying data-turbolinks-eval=always on the <script> tag.
Updated 👍 |
Add ability to re-run scripts on back/forward navigation
Thanks |
@reed good catch on the name.
|
I like it! thanks guys! |
Any idea how I could add this to code in application.js where there is no script tag? And any advice on how I'd go about using this with all the baked in bootstrap stuff that I'm using? (popovers, tooltips, modals, etc) Edit: Stupid question. Just put your code in a script tag with data-turbolinks-eval=always on the bottom of your application.html.erb. It probably should be in application.js anyway. And take it out of a document onready. Then it will fire every time, even with back and forward. |
@gregblass bind a function to the |
… by specifying
data-turbolinks-eval=true
on the<script>
tag.Fix #507.
cc @reed @kevinhughes27