Skip to content

Commit

Permalink
Fix a bug where calling pushState or replaceState before the dom had …
Browse files Browse the repository at this point in the history
…been rendered would throw an error. Fixes CodeByZach#47.
  • Loading branch information
zackbloom committed Oct 24, 2013
1 parent 7a3f487 commit 4cfc63a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
7 changes: 4 additions & 3 deletions pace.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -175,14 +175,15 @@ class Bar
document.body.className = document.body.className.replace 'pace-running', ''
document.body.className += ' pace-done'


update: (prog) ->
@progress = prog

do @render

destroy: ->
@getElement().parentNode.removeChild(@getElement())
try
@getElement().parentNode.removeChild(@getElement())
catch NoTargetError

@el = undefined

Expand Down Expand Up @@ -551,7 +552,7 @@ Pace.stop = ->

Pace.restart = ->
Pace.stop()
Pace.go()
Pace.start()

Pace.go = ->
Pace.running = true
Expand Down
8 changes: 6 additions & 2 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 4cfc63a

Please sign in to comment.