Skip to content

Commit 2283217

Browse files
committed
Merge remote-tracking branch 'origin/pr/16'
Conflicts: pace.min.js
2 parents 7666e87 + 90672bf commit 2283217

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

pace.coffee

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ defaultOptions =
2626
# Should we restart the browser when pushState or replaceState is called? (Generally
2727
# means ajax navigation has occured)
2828
restartOnPushState: true
29+
30+
# Should pace automatically start when the page is loaded, or should it wait for `start` to
31+
# be called? Always false if pace is loaded with AMD or CommonJS.
32+
startOnPageLoad: true
2933

3034
elements:
3135
# How frequently in ms should we check for the elements being tested for
@@ -169,10 +173,6 @@ class Bar
169173
done: ->
170174
@progress >= 100
171175

172-
# Every 100ms, we decide what the next progress should be
173-
# Every time a new thing happens, we decide what the progress should be
174-
# CSS animations can't give us backoff
175-
176176
class Events
177177
constructor: ->
178178
@bindings = {}
@@ -186,9 +186,10 @@ class Events
186186
@bindings[name] ?= []
187187
@bindings[name].push fn
188188

189-
# We should only ever instantiate one of these
190189
_XMLHttpRequest = window.XMLHttpRequest
191190
_XDomainRequest = window.XDomainRequest
191+
192+
# We should only ever instantiate one of these
192193
class RequestIntercept extends Events
193194
constructor: ->
194195
super
@@ -521,4 +522,5 @@ else if typeof exports is 'object'
521522
module.exports = Pace
522523
else
523524
# Global
524-
Pace.start()
525+
if options.startOnPageLoad
526+
Pace.start()

pace.js

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pace.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)