Giter VIP home page Giter VIP logo

Comments (5)

zackbloom avatar zackbloom commented on May 30, 2024

Some options I'm considering:

  • A setting to make it appear for ALL ajax requests
  • The ability to specify with a specific request that it should show the bar (at the jQuery or XMLHttpRequest level?)
  • The ability to explicitly integrate with specific Backbone Models?

from pace.

toddwprice avatar toddwprice commented on May 30, 2024

Even the ability to manually control when it shows and hides would be great. You could simply do a Pace.start() before an XHR, and Pace.stop() when it completes.

Another nice to have would be the ability to show more than one template: one when you have progress to show, one when you don't. Or just specify the template name in start().

from pace.

ryankshaw avatar ryankshaw commented on May 30, 2024

here's an easy workaround for this:


dontPace = (fn) ->
  _trackMethods = Pace.options.ajax.trackMethods
  Pace.options.ajax.trackMethods = []
  res = fn()
  Pace.options.ajax.trackMethods = _trackMethods
  res


# and then whenever you have some code that will cause an ajax request that you don't want to track in pace you can do:

$.ajax('someurl') # will be tracked in Pace
dontPace -> $.ajax('some/url') # WONT be tracked in Pace
$.ajax('another/url') # will be tracked in Pace

#or for example in angular:
dontPace ->
  $http.get('some/url')

from pace.

zackbloom avatar zackbloom commented on May 30, 2024

That's very clever. The other option would be for pace to wrap $.ajax, and make it an option to that.

from pace.

NelsonReis avatar NelsonReis commented on May 30, 2024

As @toddwprice mentioned, this would be great:

Another nice to have would be the ability to show more than one template: one when you have progress to show, one when you don't. Or just specify the template name in start().

Something like Pace.restart('templateA.css')

from pace.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.