fixed restart link at end of game
This commit is contained in:
parent
f342b4f1fa
commit
df228633c8
|
@ -65,11 +65,13 @@ class Player
|
||||||
checkGameOver: ->
|
checkGameOver: ->
|
||||||
if @container.find('a:not(.disabled):not(.external)').length == 0
|
if @container.find('a:not(.disabled):not(.external)').length == 0
|
||||||
@container.append @converter.makeHtml '## The End\n\nYou have reached the end of this story. <a id="restart" href="">Click here</a> to start over.'
|
@container.append @converter.makeHtml '## The End\n\nYou have reached the end of this story. <a id="restart" href="">Click here</a> to start over.'
|
||||||
$('#restart').click ->
|
$('#restart').data('info', [@id, @story]).click ->
|
||||||
@container.empty()
|
info = $(this).data 'info'
|
||||||
player = new Player @story, @id
|
$("##{info[0]}").empty()
|
||||||
$("##{@id}").data 'player', player
|
player = new Player info[1], info[0]
|
||||||
|
$("##{info[0]}").data 'player', player
|
||||||
player.play()
|
player.play()
|
||||||
|
return false
|
||||||
|
|
||||||
handleHref: (href) ->
|
handleHref: (href) ->
|
||||||
match = matchHref href
|
match = matchHref href
|
||||||
|
|
Loading…
Reference in New Issue