Skip to content

Commit

Permalink
Fix demo
Browse files Browse the repository at this point in the history
  • Loading branch information
zackbloom committed Sep 19, 2013
1 parent a38a61d commit cad327c
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 28 deletions.
25 changes: 17 additions & 8 deletions demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,24 @@
height: 3px;
background-color: #FFC01F;
}
.pace-inactive {
display: none;
}
</style>

<script>
paceOptions = {
elements: {
selectors: ['.x']
}
};
</script>
<script src="pace.js"></script>
<script>
function load(time){
$.ajax({
url: "http://localhost:5646/" + time,
complete: function(){
console.log('done', arguments);
}
});
var x = new XMLHttpRequest()
x.open('GET', "http://localhost:5646/" + time, true);
x.send();
};

load(20);
Expand All @@ -28,8 +35,10 @@


setTimeout(function(){
$('body').append($('<div class="x"></div>'));
}, 4000);
var el = document.createElement("div");
el.className = 'x';
document.body.appendChild(el);
}, 10000);

</script>
</head>
Expand Down
7 changes: 3 additions & 4 deletions pace.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,8 @@ getFromDOM = (key='options', json=true) ->
console.error "Error parsing inline pace options", e

window.Pace ?= {}
Pace.options ?= {}

options = extend Pace?.options, getFromDOM(), defaultOptions
options = Pace.options = extend defaultOptions, window.paceOptions, getFromDOM()

if domTheme = getFromDOM('theme', false)
options.theme = domTheme
Expand Down Expand Up @@ -403,7 +402,7 @@ do init = ->

for type in ['ajax', 'elements', 'document', 'eventLag']
if options[type] isnt false
sources.push new ELEMENT_KEYS[type](options[type])
sources.push new SOURCE_KEYS[type](options[type])

bar = new Bar

Expand All @@ -430,7 +429,7 @@ Pace.restart = ->
Pace.stop()
Pace.go()

Page.go = ->
Pace.go = ->
bar.render()

cancelAnimation = false
Expand Down
56 changes: 41 additions & 15 deletions pace.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit cad327c

Please sign in to comment.