Skip to content

Instantly share code, notes, and snippets.

@mdarby
Forked from mbleigh/gist:1175434
Created August 27, 2011 14:18
Show Gist options
  • Save mdarby/1175440 to your computer and use it in GitHub Desktop.
Save mdarby/1175440 to your computer and use it in GitHub Desktop.
GameRouter = new Backbone.Router.extend
routes:
"draw": "draw"
initialize: ->
this.gameView = new GameView()
Backbone.history.start()
draw: ->
this.gameView.draw();
GameView = new Backbone.View.extend
initialize: ->
this.render()
render: ->
$(this.el).html()
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment