Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Progress bar for partial replacement? #20

Open
adambedford opened this issue Dec 21, 2016 · 2 comments
Open

Progress bar for partial replacement? #20

adambedford opened this issue Dec 21, 2016 · 2 comments

Comments

@adambedford
Copy link

The partial replacement functionality is excellent and I use it extensively.

I've been wanting to figure out a way to provide progress feedback to the user when a partial replacement request is taking place. Form submissions work well by disabling the submit button, but links do not share that functionality.

Opening a discussion here about what the best way of giving this feedback to the user? We could disable links (CSS pointer-events / custom JS), figure out how to show the Turbolinks progress bar, or...?

@waymondo
Copy link
Owner

Sorry for the late response here. I haven't worked on extending this since Turbolinks 5 has come out, so I haven't looked into if there is a decent way to tap into the progress bar that comes with Turbolinks now. My hunch is that it would be easier to use the partial replacement system that is in the latest version of Turbolinks, but I'm very eager to be proven wrong with a pull request :)

As for an easy solution, I just pushed a commit that adds a class to forms that have active ajax requests running called turboboost-form-processing. You can use that along with CSS to make the form slightly transparent, show spinners, etc. You can always bind to the events ajax:beforeSend and ajax:complete supplied by jQuery to add custom handlers as well.

@adambedford
Copy link
Author

Thanks for the update. I'll certainly look into using the new form class. I had success implementing nprogress to show a progress bar while a turboboost request is taking place.

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

No branches or pull requests

2 participants