Skip to content

Instantly share code, notes, and snippets.

@mbleigh
Created August 27, 2011 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mbleigh/1175434 to your computer and use it in GitHub Desktop.
Save mbleigh/1175434 to your computer and use it in GitHub Desktop.
GameRouter = new Backbone.Router.extend
routes:
"start": "start"
"draw": "draw"
start: ->
this.navigate('/draw')
draw: ->
$('#sketchpad .front > div').hide()
$('#draw').show()
$('#sketchpad').removeClass("flipped")
# Causes "Uncaught TypeError: Object [object Object] has no method 'apply'" (backbone.js:1103)
window.game = new GameRouter
Backbone.history.start root: "/play"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment