turbolinks / turbolinks-classic

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

Parent option for progress bar #538

Open drewhamlett opened 9 years ago

drewhamlett commented 9 years ago

I could ditch nprogress if we had a parent option for Turbolinks.

https://github.com/rstacruz/nprogress#parent

Sometimes it's useful to be able to set a container where the progress bar will be placed at.

Thanks!

javan commented 9 years ago

One reason the progress bar is on the html element is to prevent it from being replaced when changing pages. This allows it to smoothly finish its animation after the new content is inserted.

Can you explain your specific use case?

chrise86 commented 9 years ago

I had a need for this too, where I had a sidebar and main content area and wanted the progress bar to appear in the main content area only. I solved it using the following:

html.turbolinks-progress-bar::before {
  margin-left: 220px; // where 220px is sidebar width
}

This way you can also alter it responsively as needed.