2

I would like to setup pace.js so it shows a loading animation while a pdf file is retrieved on server. But the default configuration of pace.js isn't doing it: When I click in the download link () my browser shows it's loading, but pace.js don't show up.

How can I configure it?

Bruno Lamps
  • 544
  • 6
  • 27
  • Are you downloading the file via ajax or it's an http request? A possible solution is when you click to download the file, call a function to start pace, e.g: `$('#my-download-button').click(function () { Pace.start })`. Docs: http://github.hubspot.com/pace/ – Victor Sep 08 '16 at 14:51
  • It's an http request. I'll try this idea, but will pace stop when download starts? – Bruno Lamps Sep 08 '16 at 17:13
  • I tried Pace.start, but nothing happened. Then I tried Pace.restart(), and it showed up. But the loading animation is finished way before the file arrives to the client. I put it to test by pausing the execution of the request in server side. – Bruno Lamps Sep 08 '16 at 17:31

0 Answers0