Skip to content

Commit f322630

Browse files
author
Zack Bloom
committed
Allow sources to be passed as 'true'. Fixes CodeByZach#70.
1 parent ac9c25d commit f322630

File tree

4 files changed

+59
-47
lines changed

4 files changed

+59
-47
lines changed

pace.coffee

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,12 @@ window.Pace ?= {}
174174

175175
extend Pace, Evented::
176176

177-
options = Pace.options = extend defaultOptions, window.paceOptions, getFromDOM()
177+
options = Pace.options = extend {}, defaultOptions, window.paceOptions, getFromDOM()
178+
179+
for source in ['ajax', 'document', 'eventLag', 'elements']
180+
# true enables them without configuration, so we grab the config from the defaults
181+
if options[source] is true
182+
options[source] = defaultOptions[source]
178183

179184
class NoTargetError extends Error
180185

pace.js

Lines changed: 51 additions & 44 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)