-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Actual loading progression with pjax ? #22
Comments
Yeah, This is the code I have too. But it's more like a simulation of the actual progress right ? |
Yes
|
I'm afraid there's no "official" way to find the actual progress in Pjax or Turbolinks as of right now. You may experiment with a 3rd party library like jquery-ajax-progress. |
Try this. $(document).pjax("a", '#pjax-container');
$(document).on('pjax:start', function() { NProgress.start(); });
$(document).on('pjax:end', function() { NProgress.done(); }); |
thanks @nzwsch 👍 |
@nzwsch Lovely! Thank you. |
seems like a reasonable addition to the readme. |
@rstacruz or maybe just reference nprogress-rails, which already support turbolinks... |
Is there a way to make it so that the loading bar is not displayed when a user presses the back button? |
You can use pjax:send instead of pjax:start |
I'm sorry if it has been answered elsewhere, but I only found documentation with turbolinks, but not pjax. How can I configure nprogress so it displays the "true" loading % progress of pjax requests ?
Thanks a lot !
This is my code :
$(document).pjax('a', '#pjax-container');
$(document).on('pjax:send', function() { NProgress.start(); })
$(document).on('pjax:complete', function() { NProgress.done(); })
$(document).on('pjax:timeout', function(event) { event.preventDefault(); })
From what I get it "simulates" loading, but not the actual progression. Is such a thing even possible ?
The text was updated successfully, but these errors were encountered: