Skip to content

Instantly share code, notes, and snippets.

@MikeSilvis
Created May 31, 2012 00:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MikeSilvis/2839845 to your computer and use it in GitHub Desktop.
Save MikeSilvis/2839845 to your computer and use it in GitHub Desktop.
index.js.coffee
class App extends Spine.Controller
constructor: ->
super
new Spine.SubStack
Spine.Route.setup()
@append(@rooms = new App.Rooms)
@append(@messages = new App.Messages)
class App.Root extends Spine.Stack
controllers:
messages: App.Messages
rooms: App.Rooms
routes:
'/messages' : 'messages'
'/rooms' : 'rooms'
default: 'messages'
className: 'stack rooms'
class Spine.SubStack extends Spine.Stack
constructor: ->
console.log "HERE"
for key,value of @routes
do (key,value) =>
@routes[key] = =>
@active()
@[value].active(arguments...)
super
window.App = App
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment