turbolinks / turbolinks-classic

Classic version of Turbolinks. Now deprecated in favor of Turbolinks 5.
MIT License
3.54k stars 431 forks source link

All inline script tags are executed on partial page replacement #617

Closed alecdotninja closed 9 years ago

alecdotninja commented 9 years ago

This seems counter-intuitive for me and was also causing problems with my notifications.

In my app when I want to display a notification, I write an inline script tag that calls jGrowl. I also have a search section that uses partial page replacement. The current behavior is to display the notifications every time a new set of results is inserted even through the script tag containing the notifications is not within the section that was replaced.

While data-turoblinks-eval=false prevents the notifications from being displayed again on search, it does not solve the problem because it also causes them to not be displayed when navigating the site in general.

In general, I think it would probably make more sense to only execute script tags which are within changed nodes.

Thibaut commented 9 years ago

Fixed by #618.