Skip to content
This repository has been archived by the owner on Jul 28, 2018. It is now read-only.

Turbolinks doesn't run scripts on back #507

Closed
kevinhughes27 opened this issue Apr 17, 2015 · 1 comment · Fixed by #509
Closed

Turbolinks doesn't run scripts on back #507

kevinhughes27 opened this issue Apr 17, 2015 · 1 comment · Fixed by #509

Comments

@kevinhughes27
Copy link

Looks like Turbolinks doesn't re-run scripts in the body when the back button is pressed:
https://github.com/rails/turbolinks/blob/master/lib/assets/javascripts/turbolinks.js.coffee#L94 - is there a specific reason for this? Could we change this or make it configurable?

@Thibaut

@Thibaut
Copy link
Collaborator

Thibaut commented Apr 17, 2015

@reed mentioned in #478:

Because those scripts have already been executed for that page. And since the transition cache uses fetchHistory, the scripts would run then too.

I think both use-cases are legit and we should make this opt-in. Maybe with data-turbolinks-eval=true?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants